Skip to content

Commit 3e04572

Browse files
authored
Create github-actions-demo.yml
1 parent 1d93ff4 commit 3e04572

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed
+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: CI
2+
3+
on: [pull_request, push, workflow_dispatch]
4+
5+
jobs:
6+
pre-commit:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/[email protected]
10+
- uses: actions/setup-python@v5
11+
- uses: pre-commit/[email protected]
12+
13+
test:
14+
runs-on: ubuntu-latest
15+
strategy:
16+
fail-fast: true
17+
matrix:
18+
python-version: ["3.9", "3.10", "3.11"]
19+
20+
steps:
21+
- name: Checkout source
22+
uses: actions/[email protected]
23+
24+
- name: Setup conda environment
25+
uses: conda-incubator/setup-miniconda@v3
26+
with:
27+
miniconda-version: "latest"
28+
python-version: ${{ matrix.python-version }}
29+
environment-file: ci/environment-${{ matrix.python-version }}.yml
30+
activate-environment: umfile_utils
31+
auto-activate-base: false
32+
33+
- name: Install source
34+
shell: bash -l {0}
35+
run: python -m pip install .
36+
37+
- name: List installed packages
38+
shell: bash -l {0}
39+
run: conda list
40+
41+
- name: Run tests
42+
shell: bash -l {0}
43+
run: coverage run -m --source=umfile_utils
44+
45+
umfile_utils
46+
47+
- name: Generate coverage report
48+
shell: bash -l {0}
49+
run: coverage xml
50+
51+
- name: Upload code coverage
52+
uses: codecov/codecov-action@v4
53+
with:
54+
token: ${{ secrets.codecov_token }}
55+
files: ./coverage.xml

0 commit comments

Comments
 (0)