-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (60 loc) · 1.92 KB
/
ci.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# This uses actios:
# checkout: https://github.com/actions/checkout
# cache: https://github.com/actions/cache
# codecov-action: https://github.com/codecov/codecov-action
name: CI
on:
push:
branches:
- "*"
pull_request:
branches:
- "*"
# Nothing scheduled, just PRs and pushes
# schedule:
# - cron: "0 0 * * *" # Daily at midnight
jobs:
build:
name: Build (${{ matrix.python-version }} | ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ "ubuntu-latest" ]
python-version: [ "3.8", "3.11" ]
steps:
- uses: actions/checkout@v2
- name: Cache conda
uses: actions/cache@v3
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('ci/environment-${{ matrix.python-version }}.yml') }}
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: test_env # Defined in ci/environment*.yml
miniforge-variant: Mambaforge
miniforge-version: latest
use-mamba: true
python-version: ${{ matrix.python-version }}
environment-file: ci/environment-${{ matrix.python-version }}.yml
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
- name: Set up conda environment
shell: bash -l {0}
run: |
python -m pip install -e .
conda list
- name: Update timestep in config
uses: fjogeleit/yaml-update-action@main
with:
valueFile: 'config/config.yaml'
propertyPath: 'defaults.DEF_TIMESTEP'
value: 500
commitChange: false
- name: Run chemcomp
shell: bash -l {0}
run: |
chemcomp_main -c config/config.yaml
- name: Compare with reference simulation
shell: bash -l {0}
run: |
py.test