Skip to content

Commit

Permalink
Run stardis tests on tardis PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
KasukabeDefenceForce committed Jul 29, 2024
1 parent 2cd4e19 commit e469e31
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 66 deletions.
79 changes: 79 additions & 0 deletions .github/workflows/stardis-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Stardis Tests

on:
push:
branches:
- '*'

pull_request:
branches:
- '*'

types:
- opened
- reopened
- synchronize
- labeled
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@v2
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
66 changes: 0 additions & 66 deletions .github/workflows/stardis.yml

This file was deleted.

0 comments on commit e469e31

Please sign in to comment.