Skip to content

Commit

Permalink
Merge pull request #548 from dodona-edu/fix/allow-running-tests-on-ex…
Browse files Browse the repository at this point in the history
…ternal

Allow running tests on external forks after labeling
  • Loading branch information
jorg-vr authored Oct 17, 2024
2 parents 2b61918 + 87915a8 commit b394178
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
name: CI

on: [ push ]
on:
push:
pull_request_target:
types: [labeled]

jobs:
test:
if: ${{ github.event.action != 'labeled' || (github.event.action == 'labeled' && github.event.label.name == 'run tests') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -17,6 +21,7 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./result/coverage.xml
lint:
if: ${{ github.event.action != 'labeled' || (github.event.action == 'labeled' && github.event.label.name == 'run tests') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -26,6 +31,7 @@ jobs:
- run: nix develop .#format -c poetry run isort --check-only ./tested ./tests
- run: nix develop .#format -c poetry run black --check ./tested ./tests
types:
if: ${{ github.event.action != 'labeled' || (github.event.action == 'labeled' && github.event.label.name == 'run tests') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@ on:
- '**/*.txt'
schedule:
- cron: "18 21 2 * *"
pull_request_target:
types: [labeled]

jobs:
analyze:
if: ${{ github.event.action != 'labeled' || (github.event.action == 'labeled' && github.event.label.name == 'run tests') }}
name: Analyze
runs-on: ubuntu-latest
permissions:
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Integration tests

on: [ pull_request ]
on:
pull_request:
pull_request_target:
types: [labeled]

env:
EXERCISES_COMMIT: 31ef0f174efaeba2a37415115e7fd0332573d9b2
Expand All @@ -9,6 +12,7 @@ jobs:
# Runs the test suite in a slightly modified Docker image used by Dodona.
# This is the closest to actually running the production environment there is.
tests-dodona:
if: ${{ github.event.action != 'labeled' || (github.event.action == 'labeled' && github.event.label.name == 'run tests') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -18,6 +22,7 @@ jobs:
name: Run tests in Dodona Docker image
# Runs in the Docker image to check if the JS exercises still work.
javascript-dodona:
if: ${{ github.event.action != 'labeled' || (github.event.action == 'labeled' && github.event.label.name == 'run tests') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -36,6 +41,7 @@ jobs:
name: Run integration tests in Dodona Docker image
# Runs in the repo to check if the JS exercises still work.
javascript-repository:
if: ${{ github.event.action != 'labeled' || (github.event.action == 'labeled' && github.event.label.name == 'run tests') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down

0 comments on commit b394178

Please sign in to comment.