-
Notifications
You must be signed in to change notification settings - Fork 13
83 lines (76 loc) · 2.28 KB
/
build-test.yaml
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
name: Build and Test
on:
push:
branches:
- master
pull_request:
defaults:
run:
shell: bash
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: [3.9, "3.10", "3.11", "3.12"]
sqlalchemy-version: ["1.4", "2.0"]
numpy-version: ["1.22", "1.26"]
TANGOS_TESTING_DB_BACKEND: [sqlite, mysql+pymysql, postgresql+psycopg2]
exclude:
- python-version: "3.12"
sqlalchemy-version: "1.4"
- python-version: "3.12"
numpy-version: "1.22"
runs-on: ${{ matrix.os }}
env:
C: gcc-10
CXX: g++-10
TANGOS_TESTING_DB_USER: root
TANGOS_TESTING_DB_PASSWORD: root
TANGOS_TESTING_DB_BACKEND: ${{ matrix.TANGOS_TESTING_DB_BACKEND }}
services:
postgres:
image: postgres
env:
POSTGRES_USER: root
POSTGRES_PASSWORD: root
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
steps:
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v2
- name: Install gcc
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update -qq
sudo apt install gcc-10 g++-10
- name: Install python dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install numpy~=${{ matrix.numpy-version}} sqlalchemy~=${{ matrix.sqlalchemy-version}}
- name: Build and install tangos
run: |
pip install -e .[test,rmdbs]
- name: Check that tangos can import without pynbody
run: |
python -c "import tangos"
- name: Install pynbody and yt
run: python -m pip install pynbody yt --no-build-isolation
- name: Set up MySQL
if: ${{ matrix.TANGOS_TESTING_DB_BACKEND == 'mysql+pymysql' }}
run: |
sudo /etc/init.d/mysql start
- name: Run all tests
working-directory: tests
run: python -m pytest