Skip to content

Commit

Permalink
Add github actions workflow for test-runner
Browse files Browse the repository at this point in the history
  • Loading branch information
ZIMkaRU committed Oct 11, 2023
1 parent 5411e01 commit 200e6e8
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CI
run-name: 'Run tests: Commit ${{ github.sha }}'

on:
pull_request:
types: [opened, reopened, edited]
branches:
- master
workflow_dispatch:

jobs:
linux-test-runner:
name: Linux Test Runner
timeout-minutes: 30
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-node@v3
with:
node-version: 18.17.1
- name: Setup configs
run: |
cp config/common.json.example config/common.json \
&& cp config/schedule.json.example config/schedule.json \
&& cp config/service.report.json.example config/service.report.json \
&& cp config/facs/grc.config.json.example config/facs/grc.config.json \
&& cp config/facs/grc-slack.config.json.example config/facs/grc-slack.config.json
- name: Install deps
run: npm i
- name: Run tests
run: npm test -- --reporter=json --reporter-option output=test-report.json
- uses: actions/upload-artifact@v3
if: success() || failure()
with:
name: test-results
path: test-report.json
30 changes: 30 additions & 0 deletions .github/workflows/test-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: 'Test Report'
run-name: 'Test Report: Commit ${{ github.sha }}'

on:
workflow_run:
workflows: ['CI']
types:
- completed

permissions:
contents: read
actions: read
checks: write

jobs:
web-page-report:
name: Web Page Report
runs-on: ubuntu-22.04
steps:
- uses: dorny/test-reporter@v1
id: test-results
with:
artifact: test-results
name: Mocha Tests
path: test-report.json
reporter: mocha-json
- name: Test Report Summary
run: |
echo "### Test Report page is ready! :rocket:" >> $GITHUB_STEP_SUMMARY
echo "And available at the following [Link](${{ steps.test-results.outputs.url_html }})" >> $GITHUB_STEP_SUMMARY

0 comments on commit 200e6e8

Please sign in to comment.