Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate Continuum Tests #2699

Merged
merged 29 commits into from
Jul 17, 2024
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
245e704
New experimental tests workflow
atharva-2001 Jul 12, 2024
d86f29e
Experimental setup
atharva-2001 Jul 12, 2024
19fd144
Label correction
atharva-2001 Jul 12, 2024
4a3601d
Provide label in setup
atharva-2001 Jul 12, 2024
c11ab2c
Try fixing concurrency
atharva-2001 Jul 12, 2024
3e3d9cf
Try trigger main workflow
atharva-2001 Jul 12, 2024
8728da9
Os fix
atharva-2001 Jul 12, 2024
5fae98a
Test new base job
atharva-2001 Jul 12, 2024
534dd45
Installation and artifact fixes
atharva-2001 Jul 12, 2024
f1f2a2e
Remove always
atharva-2001 Jul 12, 2024
b3fbf8a
Address install issues
atharva-2001 Jul 12, 2024
19e2110
Address install issues
atharva-2001 Jul 12, 2024
168fc06
Continuum tests need base
atharva-2001 Jul 14, 2024
80bd7c6
Experimental fast tests
atharva-2001 Jul 14, 2024
302d6e9
Minor fixes and corrections
atharva-2001 Jul 14, 2024
283e546
Add test path to job name
atharva-2001 Jul 14, 2024
dc6bd21
Disable fail fast
atharva-2001 Jul 14, 2024
1abb56e
Reduce jobs
atharva-2001 Jul 14, 2024
7fef84a
Environment fix
atharva-2001 Jul 14, 2024
c0192f9
typo fix
atharva-2001 Jul 14, 2024
7a0d9aa
Modify jobs
atharva-2001 Jul 15, 2024
3be6124
Add codecov job
atharva-2001 Jul 15, 2024
f14b46b
Modify coverage action
atharva-2001 Jul 16, 2024
55bc855
Test if this works by installing LFS
atharva-2001 Jul 16, 2024
b612753
Run codecov even if pytest fails
atharva-2001 Jul 16, 2024
71970a9
Remove setup tardis action
atharva-2001 Jul 16, 2024
f591c75
Only run if owner is tardis
atharva-2001 Jul 16, 2024
676a49f
Delete coverage file committed accidently
atharva-2001 Jul 16, 2024
16672c7
Add r packet tracking mark
atharva-2001 Jul 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 41 additions & 52 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ on:
push:
branches:
- '*'

pull_request:
branches:
- '*'
Expand All @@ -22,24 +21,52 @@ on:
env:
CACHE_NUMBER: 0 # increase to reset cache manually
PYTEST_FLAGS: --tardis-refdata=${{ github.workspace }}/tardis-refdata --tardis-regression-data=${{ github.workspace }}/tardis-regression-data
--cov=tardis --cov-report=xml --cov-report=html
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true

defaults:
run:
shell: bash -l {0}

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true


jobs:
build:
codecov:
if: github.repository_owner == 'tardis-sn'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup LFS
uses: ./.github/actions/setup_lfs
- name: Setup environment
uses: ./.github/actions/setup_env
with:
os-label: linux-64
- name: Generate coverage report
run: |
pytest --cov=tardis --cov-report=xml --cov-report=html
- uses: codecov/codecov-action@v4
if: always()
with:
fail_ci_if_error: true
token: ${{ env.CODECOV_TOKEN }}
verbose: true

tests:
name: ${{ matrix.continuum }} continuum ${{ matrix.rpacket_tracking }} rpacket_tracking ${{ matrix.os }}
if: github.repository_owner == 'tardis-sn'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
pip: [true, false]
label: [osx-arm64, linux-64]
continuum: ['not', '']
rpacket_tracking: ['not', '']
exclude:
- continuum: ''
rpacket_tracking: ''
include:
- label: osx-arm64
os: macos-latest
Expand All @@ -48,9 +75,6 @@ jobs:
- label: linux-64
os: ubuntu-latest
prefix: /usr/share/miniconda3/envs/tardis

name: ${{ matrix.label }}-pip-${{ matrix.pip }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4

Expand All @@ -59,51 +83,16 @@ jobs:

- name: Setup environment
uses: ./.github/actions/setup_env
with:
with:
os-label: ${{ matrix.label }}

- name: Install package editable
run: |
pip install -e .
echo "TARDIS_PIP_PATH=tardis" >> $GITHUB_ENV
if: matrix.pip == false

- name: Install package git
run: pip install git+https://github.com/tardis-sn/tardis.git@${{ github.ref }}
if: matrix.pip == true

- name: Set pip path
if: matrix.pip == true
run: |
location_line=$(pip show tardis | grep -i -x "Location:.*")
directory_path=$(echo $location_line | awk -F " " '{print $2}')
echo "TARDIS_PIP_PATH=$directory_path" >> $GITHUB_ENV

- name: Set install path
if: matrix.pip == false
- name: Install package editable
run: |
directory_path="."
echo "TARDIS_PIP_PATH=$directory_path" >> $GITHUB_ENV
pip install -e . --user

- name: Run tests
run: pytest tardis ${{ env.PYTEST_FLAGS }} -m "not (continuum or rpacket_tracking)"
working-directory: ${{ env.TARDIS_PIP_PATH }}
if: always()

- name: Upload to Codecov
run: bash <(curl -s https://codecov.io/bash)

- name: Run continuum tests
run: pytest tardis ${{ env.PYTEST_FLAGS }} -m continuum
working-directory: ${{ env.TARDIS_PIP_PATH }}
if: always()

- name: Run rpacket tracking tests
run: pytest tardis ${{ env.PYTEST_FLAGS }} -m rpacket_tracking
working-directory: ${{ env.TARDIS_PIP_PATH }}
if: always()
run: pytest tardis ${{ env.PYTEST_FLAGS }} -m "${{ matrix.continuum }} continuum and ${{ matrix.rpacket_tracking }} rpacket_tracking"

- name: Refdata Generation tests
run: pytest tardis ${{ env.PYTEST_FLAGS }} --generate-reference
working-directory: ${{ env.TARDIS_PIP_PATH }}
if: contains(github.event.pull_request.labels.*.name, 'run-generation-tests') || github.ref == 'refs/heads/master'
run: pytest tardis ${{ env.PYTEST_FLAGS }} --generate-reference -m "${{ matrix.continuum }} continuum and ${{ matrix.rpacket_tracking }} rpacket_tracking"
if: contains(github.event.pull_request.labels.*.name, 'run-generation-tests') || github.ref == 'refs/heads/master'
Loading