forked from openedx/course-discovery
-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (58 loc) · 1.84 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
name: CI
on:
pull_request:
jobs:
pytest:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['py38', 'py311', 'py312']
django-version: ['django42']
db-version: ['mysql80']
pytest-split-group: [1, 2, 3, 4, 5, 6]
status: ['']
steps:
- uses: actions/checkout@v3
- run: make ci_up
- name: run tests
env:
DB_HOST: ${{ matrix.db-version }}
PYTEST_SPLIT_GROUP: ${{ matrix.pytest-split-group }}
run: make ci_test TOXENV=${{ matrix.python-version }}-${{ matrix.django-version }}
# Unfortunately, continue-on-error marks the job as successful. We really want something like "allow failure"
# that would note the failure, but not fail the entire workflow and not email the author about it.
# See https://github.com/actions/toolkit/issues/399
continue-on-error: ${{ matrix.status == 'ignored' }}
- name: Upload coverage
if: matrix.db-version == 'mysql80'
uses: actions/upload-artifact@v2
with:
name: coverage${{ matrix.pytest-split-group }}
path: .coverage
# Combine and upload coverage reports.
coverage:
needs: pytest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: make ci_up
- name: Download all artifacts
# Downloads coverage1, coverage2, etc.
uses: actions/download-artifact@v2
- name: Run coverage
run: make ci_coverage
- uses: codecov/codecov-action@v1
quality:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: make ci_up
- run: make ci_quality
semgrep:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: make ci_up
- name: Run semgrep Django rules
run: make ci_semgrep