2023-09-14 18:47:22 +01:00
|
|
|
name: Tests
|
2023-09-14 18:41:38 +01:00
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
2023-09-14 18:47:22 +01:00
|
|
|
Run-Tests:
|
2023-09-14 18:41:38 +01:00
|
|
|
runs-on: ubuntu-22.04
|
2023-09-14 19:00:01 +01:00
|
|
|
env:
|
|
|
|
DEBIAN_FRONTEND: noninteractive
|
2023-09-14 18:41:38 +01:00
|
|
|
steps:
|
|
|
|
- name: Check out repository code
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
- run: cd ${{ github.workspace }}
|
2023-09-14 19:02:43 +01:00
|
|
|
- name: Run checker (passing)
|
2023-09-14 18:41:38 +01:00
|
|
|
run: |
|
2023-09-14 19:02:43 +01:00
|
|
|
cd tests/pass/
|
|
|
|
python3 ../../run-tests.py
|
|
|
|
- name: Run checker (failing)
|
|
|
|
run: |
|
|
|
|
cd tests/fail/
|
2023-09-16 16:36:37 +01:00
|
|
|
! python3 ../../run-tests.py
|
2023-09-15 21:23:20 +01:00
|
|
|
- name: Update badges (fail)
|
2023-09-16 16:34:51 +01:00
|
|
|
if: needs.pr-check.outputs.number != 'null' && github.ref == 'refs/heads/main' && failure()
|
2023-09-15 21:23:54 +01:00
|
|
|
run: |
|
2023-09-16 16:34:51 +01:00
|
|
|
curl -f -X 'GET' \
|
2023-09-15 21:23:54 +01:00
|
|
|
'https://badgeapi.docker.162536.xyz/set_badge/?repo=marmoset-test-cases&new_badge=Tests-failing-red' \
|
|
|
|
-H 'accept: application/json' \
|
2023-09-16 16:36:37 +01:00
|
|
|
-H 'X-API-Key: ${{ secrets.BADGE_API_KEY }}'
|
|
|
|
- name: Update badges (success)
|
|
|
|
if: needs.pr-check.outputs.number != 'null' && github.ref == 'refs/heads/main' && success()
|
|
|
|
run: |
|
|
|
|
curl -f -X 'GET' \
|
|
|
|
'https://badgeapi.docker.162536.xyz/set_badge/?repo=marmoset-test-cases&new_badge=Tests-passing-brightgreen' \
|
|
|
|
-H 'accept: application/json' \
|
2023-09-15 21:23:54 +01:00
|
|
|
-H 'X-API-Key: ${{ secrets.BADGE_API_KEY }}'
|