Skip to content

Commit

Permalink
#22706 Adding a new GHA for running CLI tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
dcolina committed Jul 2, 2023
1 parent f7604e1 commit 00da6a0
Show file tree
Hide file tree
Showing 5 changed files with 337 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/actions/run-cli-tests/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# action.yml
name: 'dotCMS CLI tests'
description: 'Runs CLI tool tests'
author: 'danielcolina-dotcms'
inputs:
docker_image:
description: 'Docker image to use'
required: true
default: 'nginx'
outputs:
time:
description: 'Index page'
runs:
using: node16
main: 'dist/index.js'
12 changes: 12 additions & 0 deletions .github/actions/run-cli-tests/dist/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const core = require('@actions/core');
const github = require('@actions/github');

try {
const dockerImage = core.getInput('docker-image');
const time = new Date().toTimeString();

console.log(`Hello ${dockerImage}!`);
core.setOutput('time', time);
} catch (error) {
core.setFailed(error.message);
}
236 changes: 236 additions & 0 deletions .github/actions/run-cli-tests/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions .github/actions/run-cli-tests/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "run-cli-tests",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@actions/core": "^1.10.0",
"@actions/github": "^5.1.1"
}
}
58 changes: 58 additions & 0 deletions .github/workflows/cli-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: CLI Tests
on:
pull_request:
paths:
- 'tools/dotcms-cli/api-data-model/**'
- 'tools/dotcms-cli/cli/**'
push:
branches:
- master
- 'release-*'
jobs:
cli_test:
name: CLI Tests
runs-on: ubuntu-latest
steps:
- id: run-dotcms-cli-tests
name: Run DotCMS CLI Tests
uses: ./.github/actions/run-cli-tests
with:
docker_image: nginx

- id: git-checkout
name: Checkout
uses: actions/checkout@v3

- name: tests
working-directory: ./tools/dotcms-cli
run: |
echo "tests"
# - id: run-postman-tests
# name: Run Postman Tests
# timeout-minutes: 90
# uses: ./.github/actions/run-postman-tests
# with:
# built_image_name: ${{ needs.postman-tests-setup-job.outputs.built_image_name }}
# license_key: ${{ secrets.DOTCMS_LICENSE }}
# tests: ${{ steps.get-commit-message.outputs.commit_message }}
# parallel_collection: ${{ matrix.parallel_collection }}
# export_report: ${{ env.PUBLISH_MODE == 'ALL' || env.PUBLISH_MODE == 'RESULTS' }}



# - name: tests
# working-directory: ./tools/dotcms-cli
# run: |
# echo "tests"
# ./gradlew clean test








0 comments on commit 00da6a0

Please sign in to comment.