-
Notifications
You must be signed in to change notification settings - Fork 9
74 lines (61 loc) · 2.01 KB
/
CDA-testing.yml
File metadata and controls
74 lines (61 loc) · 2.01 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
65
66
67
68
69
70
71
72
73
74
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
integration-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Clean up disk space, so we don't run out.
if: runner.os == 'Linux'
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
- name: Set up backend
run: |
docker compose pull
docker compose up -d
- name: Set Up Python
uses: actions/setup-python@v6
with:
python-version: '3.9.X'
# Use actions-poetry to handle installation
- name: Install Poetry and Dependencies
uses: abatilo/actions-poetry@v4
# Set Poetry to use an in-project virtual environment
- name: Configure Poetry for in-project venv
run: poetry config virtualenvs.in-project true
# Poetry will handle installation and caching
- name: Cache Python dependencies
uses: actions/cache@v5
id: cache-poetry-venv
with:
path: .venv
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}
# Install dependencies only if cache is missed
- name: Install dependencies
if: steps.cache-poetry-venv.outputs.cache-hit != 'true'
run: poetry install --no-root
# Run pytest and generate coverage report data.
- name: Run Tests and Check Types
run: |
poetry run pytest tests/cda/ --doctest-modules --cov --cov-report=xml:out/coverage.xml
poetry run mypy --strict cwms/
- name: Generate Coverage Report
uses: irongut/CodeCoverageSummary@v1.3.0
with:
filename: out/coverage.xml
format: markdown
output: both
badge: true
- name: Generate Job Summary
uses: x-color/github-actions-job-summary@v0.1.1
with:
file: ./code-coverage-results.md
vars: |-
empty: empty