-
-
Notifications
You must be signed in to change notification settings - Fork 422
73 lines (62 loc) · 1.83 KB
/
stardis-tests.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
63
64
65
66
67
68
69
70
71
72
73
name: stardis-tests
on:
push:
branches:
- master
pull_request:
branches:
- master
types:
- opened
- reopened
- synchronize
- ready_for_review
workflow_dispatch:
defaults:
run:
shell: bash -l {0}
env:
CACHE_NUMBER: 0 # increase to reset cache manually
jobs:
build:
strategy:
matrix:
label: [linux-64]
include:
- os: ubuntu-latest
label: linux-64
prefix: /usr/share/miniconda3/envs/stardis
name: ${{ matrix.label }}
runs-on: ${{ matrix.os }}
if: ${{ !github.event.pull_request.draft }}
steps:
- uses: actions/checkout@v4
with:
repository: tardis-sn/stardis
- name: Download Lock File
run: wget -q https://raw.githubusercontent.com/tardis-sn/stardis/main/conda-${{ matrix.label }}.lock
shell: bash
- name: Generate Cache Key
run: |
file_hash=$(cat conda-${{ matrix.label }}.lock | shasum -a 256 | cut -d' ' -f1)
echo "file_hash=$file_hash" >> "${GITHUB_OUTPUT}"
id: cache-environment-key
shell: bash
- uses: mamba-org/setup-micromamba@v1
with:
environment-file: conda-${{ matrix.label }}.lock
cache-environment-key: ${{ steps.cache-environment-key.outputs.file_hash }}
cache-downloads-key: ${{ steps.cache-environment-key.outputs.file_hash }}
environment-name: stardis
cache-environment: true
cache-downloads: true
- name: Install tardis
id: install-tardis
run: |
pip install git+https://github.com/tardis-sn/tardis.git@${{ github.sha }}
- name: Install stardis
id: install-stardis
run: |
pip install -e .[test]
- name: Run stardis tests
run: pytest