-
Notifications
You must be signed in to change notification settings - Fork 5
101 lines (98 loc) · 3.24 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: CI
on:
push:
pull_request_target:
types: [labeled]
env:
EXERCISES_COMMIT: 31ef0f174efaeba2a37415115e7fd0332573d9b2
jobs:
build_devcontainer:
if: ${{ github.event.action != 'labeled' || (github.event.action == 'labeled' && github.event.label.name == 'run tests') }}
uses: ./.github/workflows/build_devcontainer.yml
secrets: inherit
test:
needs: [build_devcontainer]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Run tests in container
uses: devcontainers/ci@v0.3
with:
imageName: dodona/dodona-tested
imageTag: dev
push: never
runCmd: pytest -n auto --cov=tested --cov-report=xml tests/
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./result/coverage.xml
lint:
needs: [build_devcontainer]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Run isort
uses: devcontainers/ci@v0.3
with:
imageName: dodona/dodona-tested
imageTag: dev
push: never
runCmd: isort --check-only --diff ./tested ./tests
- name: Run black
uses: devcontainers/ci@v0.3
with:
imageName: dodona/dodona-tested
imageTag: dev
push: never
runCmd: black --check ./tested ./tests
types:
needs: [build_devcontainer]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Run pyright
uses: devcontainers/ci@v0.3
with:
imageName: dodona/dodona-tested
imageTag: dev
push: never
runCmd: pyright ./tested ./tests
# check if the JS exercises still work.
javascript-dodona:
needs: [build_devcontainer]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- run: |
echo "$JAVASCRIPT_EXERCISES_KEY" > private
chmod 0600 private
GIT_SSH_COMMAND='ssh -o "StrictHostKeyChecking no" -i private' git clone git@github.ugent.be:Scriptingtalen/javascript-oefeningen.git
rm private
env:
JAVASCRIPT_EXERCISES_KEY: ${{ secrets.JAVASCRIPT_EXERCISES_KEY }}
- run: git checkout $EXERCISES_COMMIT
working-directory: ./javascript-oefeningen
- name: Run tests in container
uses: devcontainers/ci@v0.3
env:
EXERCISE_REPO: javascript-oefeningen
with:
imageName: dodona/dodona-tested
imageTag: dev
push: never
runCmd: pytest -x -n auto tests/test_integration_javascript.py
env: |
EXERCISE_REPO