Update test.yml #166
Workflow file for this run
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
--- | |
name: Test | |
on: | |
push: | |
merge_group: | |
schedule: | |
- cron: 0 13 * * 1 | |
workflow_dispatch: | |
jobs: | |
lint: | |
name: Format, lint, and type check | |
runs-on: macos-15 | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
cache: pip | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip wheel setuptools mypy | |
python -m pip install -r requirements.txt | |
- name: Install artisatomic | |
run: | | |
python -m pip install -e . | |
- name: Lint with mypy | |
run: | | |
mypy --install-types --non-interactive | |
- name: Run Ruff | |
if: always() | |
uses: astral-sh/ruff-action@v2 | |
with: | |
version: 0.8.1 | |
args: check --exit-non-zero-on-fix --no-fix | |
- name: Run Ruff Format | |
if: always() | |
uses: astral-sh/ruff-action@v2 | |
with: | |
version: 0.8.1 | |
args: format --check | |
pytest: | |
runs-on: macos-15 | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
cache: pip | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip wheel setuptools | |
python -m pip install -r requirements.txt | |
- name: Install artisatomic | |
run: | | |
python -m pip install -e . | |
- name: Cache CMFGEN atomic data | |
uses: actions/cache@v4 | |
id: cache-cmfgendata | |
with: | |
path: atomic-data-hillier/atomic_data_15nov16.tar.xz | |
key: atomic-data-hillier/atomic_data_15nov16.tar.xz | |
- name: Download/extract CMFGEN atomic data | |
working-directory: atomic-data-hillier/ | |
run: source ./setup_cmfgen_data.sh | |
- name: Test with pytest | |
run: pytest | |
tests: | |
strategy: | |
matrix: | |
testname: [cmfgen, jplt, floers25] | |
fail-fast: false | |
runs-on: macos-15 | |
timeout-minutes: 45 | |
name: test ${{ matrix.testname }} | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
cache: pip | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip wheel setuptools | |
python -m pip install -r requirements.txt | |
- name: Install artisatomic | |
run: | | |
python -m pip install -e . | |
- name: Cache CMFGEN atomic data | |
uses: actions/cache@v4 | |
id: cache-cmfgendata | |
with: | |
path: atomic-data-hillier/atomic_data_15nov16.tar.xz | |
key: atomic-data-hillier/atomic_data_15nov16.tar.xz | |
- name: Download/extract CMFGEN atomic data | |
working-directory: atomic-data-hillier/ | |
run: source ./setup_cmfgen_data.sh | |
- name: Cache JPLT atomic data | |
if: matrix.testname == 'jplt' | |
uses: actions/cache@v4 | |
id: cache-jpltdata | |
with: | |
path: atomic-data-tanaka-jplt/data_v1.1/** | |
key: atomic-data-tanaka-jplt/data_v1.1 | |
- name: Download/extract JPLT atomic data | |
if: matrix.testname == 'jplt' | |
working-directory: atomic-data-tanaka-jplt/ | |
run: source ./setup_jplt_data.sh | |
- name: Generate artis atomic data files | |
run: | | |
cp tests/${{ matrix.testname }}/artisatomicionhandlers.json . | |
makeartisatomicfiles -output_folder tests/${{ matrix.testname }}/output | |
- name: Extract Floers25 atomic data | |
if: matrix.testname == 'floers25' | |
working-directory: atomic-data-floers25/ | |
run: tar -zxvf testdata.tar.xz | |
- name: Generate artis atomic data files | |
run: | | |
cp tests/${{ matrix.testname }}/artisatomicionhandlers.json . | |
makeartisatomicfiles -output_folder tests/${{ matrix.testname }}/output | |
- name: Checksum output files | |
working-directory: tests/${{ matrix.testname }}/output | |
run: | | |
cat compositiondata.txt | |
cat *.json | |
md5sum *.txt | |
md5sum -c ../checksums.txt | |
- name: tar and zip output files | |
if: always() | |
run: | | |
tar -cvzf artis_files_${{ matrix.testname }}.tar.gz tests/${{ matrix.testname }}/output/* | |
- name: Upload output files | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: artis_files_${{ matrix.testname }}.tar.gz | |
path: artis_files_${{ matrix.testname }}.tar.gz |