-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (54 loc) · 1.71 KB
/
ci-tests.yml
File metadata and controls
59 lines (54 loc) · 1.71 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
# GitHub Actions workflow for testing and continuous integration.
name: CI Tests
on:
push:
branches:
- main
tags:
- "*"
pull_request:
# branches: # only build on PRs against 'main' if you need to further limit when CI is run.
# - main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
ARCH_ON_CI: "normal"
IS_CRON: "false"
PYTHON_VERSION: "3.11"
jobs:
s2geometry:
uses: Small-Bodies-Node/sbsearch/.github/workflows/s2geometry-venv.yml@main
test:
name: CI testing
needs: [s2geometry]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: "${{ env.PYTHON_VERSION }}"
- name: Restore virtual environment from cache
uses: actions/cache/restore@v4
id: cache
with:
key: s2geometry-py${{ steps.setup-python.outputs.python-version }}
path: |
~/.venv
- name: Install code and dependences
run: |
source ~/.venv/bin/activate
LDFLAGS="-L${VIRTUAL_ENV}/lib -Wl,-rpath=${VIRTUAL_ENV}/lib" CXXFLAGS="-I${VIRTUAL_ENV}/include" python3 -m pip install 'sbsearch[recommended] @ git+https://github.com/Small-Bodies-Node/sbsearch.git'
python3 -m pip install -e .[test,figures]
- name: Run tests
run: |
source ~/.venv/bin/activate
pip freeze
pytest catch -v --cov=catch --cov-report=xml --remote-data
- name: Upload results to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}