-
Notifications
You must be signed in to change notification settings - Fork 47
80 lines (80 loc) · 2.61 KB
/
tests.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
name: Tests
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
permissions:
contents: read
issues: read
checks: write
pull-requests: write
jobs:
lint:
if: "!contains(github.event.head_commit.message, '[skip]')"
runs-on: ubuntu-latest
concurrency:
group: lint-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
- name: Cache .venv_dev/dev
id: cache-venv-dev-dev
uses: actions/cache@v3
with:
path: .venv_dev/dev
key: lint-venv-dev-dev-${{ runner.os }}-${{ hashFiles('src/requirements-dev.txt') }}
- name: Lint
run: sudo -H -E ./lint.sh
test:
if: "!contains(github.event.head_commit.message, '[skip]')"
runs-on: "cirun-aws-runner--${{ github.run_id }}"
concurrency:
group: test-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup upterm session
uses: lhotari/action-upterm@v1
with:
limit-access-to-users: AjayP13
- name: Setup Python
uses: actions/setup-python@v5
- name: Cache PROJECT_DATA
id: cache-project-data
uses: actions/cache@v3
with:
path: /tmp/project_data
key: test-project-data-${{ runner.os }}-${{ hashFiles('.cluster/**/*.sh') }}
- name: Cache .venv/prod
id: cache-venv-prod
uses: actions/cache@v3
with:
path: .venv/prod
key: test-venv-prod-${{ runner.os }}-${{ hashFiles('src/requirements-dev.txt', 'src/requirements-test.txt', 'src/requirements.txt', 'src/requirements-cpu.txt', 'src/requirements-accelerator-device.txt') }}
- name: Run tests
run: sudo -H -E env "PATH=$PATH" ./run.sh -k "test_python_version" -vvvv --durations=0 --junitxml=./test.xml
env:
PROJECT_DATA: /tmp/project_data
PROJECT_DISABLE_TUNNEL: 1
PROJECT_JOB_NAME: "test" # This makes run.sh run with `pytest` instead of `python3`
HUGGING_FACE_HUB_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
id: test-results
if: always()
with:
files: "test.xml"
check_name: "Test Results"
comment_title: "Test Results"
comment_mode: "off"
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}