-
Notifications
You must be signed in to change notification settings - Fork 23
64 lines (59 loc) · 2.02 KB
/
unit_tests.yml
File metadata and controls
64 lines (59 loc) · 2.02 KB
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
name: Unit tests
on:
push:
branches:
- 'main'
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
test-js:
runs-on: ubuntu-latest
if: github.repository == 'mozmeao/springfield'
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: "Install JS dependencies"
run: npm ci
- name: "Run JS tests"
run: xvfb-run npm test
test-python:
runs-on: ubuntu-latest
if: github.repository == 'mozmeao/springfield'
steps:
- uses: actions/checkout@v6
- name: "Run Python tests (on Docker)"
run: |
make clean test-image
CONTAINER_ID=$(docker ps -alq)
docker cp $CONTAINER_ID:/app/python_coverage .
timeout-minutes: 60
- name: "Store coverage as an artifact"
uses: actions/upload-artifact@v4
with:
name: coverage-results
path: python_coverage
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v4
with:
# A CodeCov token is normally NOT needed for public repos, but this workaround is suggested here:
# https://community.codecov.com/t/upload-issues-unable-to-locate-build-via-github-actions-api/3954/18
token: ${{ secrets.CODECOV_TOKEN }}
files: python_coverage/coverage.xml
fail_ci_if_error: false # optional (default = false)
verbose: true # optional (default = false)
test-python-more: # This is a preview `test-ci` to replace the previous `test-image` over time
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' }} # Only run the extra release checks on PRs for now
steps:
- uses: actions/checkout@v6
- name: "Run Python tests (on Docker) with extra release service build"
run: |
make clean test-ci
timeout-minutes: 60