-
-
Notifications
You must be signed in to change notification settings - Fork 405
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run stardis tests on Tardis PRs (#2753)
* Writing stardis test workflow * Run stardis tests on tardis PRs * Renaming as per conventions * Removing types of pull request * Fixiing workflow name
- Loading branch information
1 parent
887fcdb
commit 17ee287
Showing
1 changed file
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name: stardis-tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- '*' | ||
|
||
pull_request: | ||
branches: | ||
- '*' | ||
|
||
workflow_dispatch: | ||
|
||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
||
env: | ||
CACHE_NUMBER: 0 # increase to reset cache manually | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
label: [osx-64, linux-64] | ||
include: | ||
- os: ubuntu-latest | ||
label: linux-64 | ||
prefix: /usr/share/miniconda3/envs/stardis | ||
|
||
- os: macos-latest | ||
label: osx-64 | ||
prefix: /Users/runner/miniconda3/envs/stardis | ||
|
||
name: ${{ matrix.label }} | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
repository: tardis-sn/stardis | ||
|
||
- name: Setup Mambaforge | ||
uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
miniforge-variant: Mambaforge | ||
miniforge-version: latest | ||
activate-environment: stardis | ||
use-mamba: true | ||
|
||
- name: Cache lockfile | ||
uses: actions/cache@v4 | ||
with: | ||
path: ${{ matrix.prefix }} | ||
key: conda-${{ matrix.label }}-${{ hashFiles(format('conda-{0}.lock', matrix.label)) }}-${{ env.CACHE_NUMBER }} | ||
id: cache-conda | ||
|
||
- name: Update Conda Environment | ||
id: update-env | ||
run: | | ||
mamba update -n stardis --file conda-${{ matrix.label }}.lock | ||
if: steps.cache-conda.outputs.cache-hit != '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 |