-
-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (56 loc) · 1.62 KB
/
test-prs.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
name: Tests
on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
env:
TEST: 1
EXTRA_COMPOSE_TEST_OPTIONS: "-e NO_REAL_MODELS=1 -e NO_SENTRY_INTEGRATION=1"
steps:
- name: Remove unnecessary files
run: |
df / -h
sudo rm -rf /usr/share/dotnet
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
df / -h
- uses: actions/checkout@v3
- name: Clean for PR build
run: |
rm -rf ./models
mkdir models
while IFS= read -r line
do
sed -i.bak "/^$line/d" requirements.txt
done < model.requirements.txt
shell: bash
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build docker image (with cache)
uses: docker/build-push-action@v5
with:
context: .
load: true
cache-from: type=gha
cache-to: type=gha,mode=min
- name: Prepare docker compose environment
run: |
make update
- name: Typecheck with mypy
run: |
make mypy
- name: Test with pytest
run: |
make test
- name: Upload to codecov
if: ${{ always() }}
uses: codecov/codecov-action@e0b68c6749509c5f83f984dd99a76a1c1a231044 # v4.0.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: '.artifacts/coverage.xml'
override_commit: ${{ github.event.pull_request.head.sha }}
plugin: noop
verbose: true