From ef2ad784da2a8af939bfc5550b6189888b942a2b Mon Sep 17 00:00:00 2001 From: Wolfgang Schnerring Date: Wed, 10 Jan 2024 11:59:00 +0100 Subject: [PATCH] ZO-4407: Run tests via GHA --- .github/workflows/testrunner.yaml | 42 +++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/testrunner.yaml diff --git a/.github/workflows/testrunner.yaml b/.github/workflows/testrunner.yaml new file mode 100644 index 0000000..c0425fd --- /dev/null +++ b/.github/workflows/testrunner.yaml @@ -0,0 +1,42 @@ +name: Testrunner + +on: + push: + branches: + - "main" + pull_request: + +env: + PROJECT: zappi-spec + BUILD_URL: "${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}" + +jobs: + test: + runs-on: zon-ubuntu-general-dind + permissions: + contents: "read" + + steps: + - uses: actions/checkout@v4.1.1 + + - uses: actions/setup-python@v5.0.0 + with: + python-version: "3.12" + cache: "pipenv" + - run: pip install pipenv + + - uses: actions/setup-node@v4.0.0 + with: + node-version: "20" + cache: "npm" + cache-dependency-path: "docs/api/package-lock.json" + + - run: bin/test + + - uses: slackapi/slack-github-action@v1.24.0 + if: failure() && github.ref_name == 'main' + with: + channel-id: "${{secrets.SLACK_TEAM_CONTENT_CHANNEL_ID}}" + slack-message: ":small_red_triangle_down: <${{env.BUILD_URL}}|${{env.PROJECT}}> tests failed" + env: + SLACK_BOT_TOKEN: ${{secrets.SLACK_BOT_TOKEN}}