Repository navigation
111 lines (90 loc) · 2.99 KB
/
Copy pathci.yml
File metadata and controls
111 lines (90 loc) · 2.99 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: ESM Tests
on:
pull_request:
branches:
- "**"
workflow_dispatch:
merge_group:
types: [checks_requested]
permissions:
contents: read
pull-requests: write
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
test-precommit:
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Environment
uses: prefix-dev/setup-pixi@v0.9.0
with:
pixi-version: v0.70.2
cache: false
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
- name: Check formatting and typing
run: pixi run --environment dev lint-all
test-esm:
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Environment
uses: prefix-dev/setup-pixi@v0.9.0
with:
pixi-version: v0.70.2
cache: false
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
- name: Run tests
run: pixi run --environment dev cov-test
- name: Run Docker tests
env:
DOCKER_TAG: ${{ github.sha }}
BIOHUB_URL: https://biohub.ai/
ESM_API_KEY: ${{ secrets.ESM_API_KEY }}
run: |
set -e
cd tests
make build-oss-ci
make start-docker-oss URL=${{ env.BIOHUB_URL }} DOCKER_TAG=${{ env.DOCKER_TAG }} ESM_API_KEY=${{ env.ESM_API_KEY }}
shell: pixi run --environment dev bash -e {0}
- name: cleanup docker containers if they're hanging
if: ${{ always() }}
run: |
docker rm --force --volumes $(docker ps -q) || true
# Next two steps adds a comment to any PR that reports tests + code coverage.
- name: Pytest Coverage Comment
if: ${{ github.event_name == 'pull_request' }}
uses: MishaKav/pytest-coverage-comment@v1.1.47
id: coverageComment
with:
title: Coverage Report
pytest-coverage-path: pytest-coverage.txt
junitxml-path: pytest.xml
report-only-changed-files: true
- name: Pytest coverage GitHub summary
if: ${{ github.event_name == 'pull_request' }}
run: |
echo '${{ steps.coverageComment.outputs.coverageHtml }}' >> $GITHUB_STEP_SUMMARY
# `requires-python` no longer caps at 3.13, so the versions above it need
# exercising. Tests only: the Docker suite and the coverage comment stay on the
# 3.12 job, so they run once, against one environment and one set of secrets.
test-esm-python-versions:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
environment: [dev-py313, dev-py314]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Environment
uses: prefix-dev/setup-pixi@v0.9.0
with:
pixi-version: v0.70.2
environments: ${{ matrix.environment }}
cache: false
- name: Run tests
run: pixi run --environment ${{ matrix.environment }} cov-test