From 797af4ef9470b4302e29c1145259273ab7bc3ad8 Mon Sep 17 00:00:00 2001 From: Vladimir Voronkov Date: Mon, 9 Oct 2023 12:59:55 +0300 Subject: [PATCH] Add github actions workflow for test-runner --- .github/workflows/ci.yml | 45 +++++++++++++++++++++++++++++++ .github/workflows/test-report.yml | 23 ++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/test-report.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..122f3100 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,45 @@ +name: CI +# run-name: 'Test: Commit ${{ github.sha }}' + +on: + pull_request: + types: [opened, reopened, edited] + branches: + - master + workflow_dispatch: + +jobs: + linux-test-runner: + timeout-minutes: 90 + 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/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 + id: test-runner + uses: nick-fields/retry@v2 + continue-on-error: false + with: + timeout_minutes: 20 + retry_wait_seconds: 10 + max_attempts: 3 + retry_on: any + command: 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 diff --git a/.github/workflows/test-report.yml b/.github/workflows/test-report.yml new file mode 100644 index 00000000..e5cf3bd7 --- /dev/null +++ b/.github/workflows/test-report.yml @@ -0,0 +1,23 @@ +name: 'Test Report' + +on: + workflow_run: + workflows: ['CI'] + types: + - completed + +permissions: + contents: read + actions: read + checks: write + +jobs: + report: + runs-on: ubuntu-22.04 + steps: + - uses: dorny/test-reporter@v1 + with: + artifact: test-results + name: Tests + path: test-report.json + reporter: mocha-json