34 lines
1.3 KiB
YAML
34 lines
1.3 KiB
YAML
name: Tests
|
|
on: [push, pull_request]
|
|
jobs:
|
|
Run-Tests:
|
|
runs-on: ubuntu-22.04
|
|
env:
|
|
DEBIAN_FRONTEND: noninteractive
|
|
steps:
|
|
- name: Check out repository code
|
|
uses: actions/checkout@v3
|
|
- run: cd ${{ github.workspace }}
|
|
- name: Run checker (passing)
|
|
run: |
|
|
cd tests/pass/
|
|
python3 ../../run-tests.py
|
|
- name: Run checker (failing)
|
|
run: |
|
|
cd tests/fail/
|
|
! python3 ../../run-tests.py
|
|
- name: Update badges (fail)
|
|
if: needs.pr-check.outputs.number != 'null' && github.ref == 'refs/heads/main' && failure()
|
|
run: |
|
|
curl -f -X 'GET' \
|
|
'https://badgeapi.docker.162536.xyz/set_badge/?repo=marmoset-test-cases&new_badge=Tests-failing-red' \
|
|
-H 'accept: application/json' \
|
|
-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' \
|
|
-H 'X-API-Key: ${{ secrets.BADGE_API_KEY }}'
|