-
Notifications
You must be signed in to change notification settings - Fork 1
47 lines (39 loc) · 1.14 KB
/
build_and_test.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
name: Build and Test (Flit)
on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
jobs:
build-and-test-flit:
runs-on: ubuntu-latest
steps:
# Step 1: Check out the repository
- name: Check out repository
uses: actions/checkout@v2
# Step 2: Set up Python
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
# Step 3: Install Flit, pytest, pytest-cov, and Coverage
- name: Install Flit, pytest, pytest-cov, and Coverage
run: |
pip install flit pytest pytest-cov coverage
# Step 4: Install dependencies (including dev dependencies)
- name: Install dependencies
run: |
export FLIT_ROOT_INSTALL=1
flit install --deps=develop --extras=dev # Install dev dependencies
# Step 5: Run tests with coverage
- name: Run tests
run: |
coverage run --source=gds_fdtd -m pytest
coverage report
# Step 6: Upload coverage reports to Codecov
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}