Test #271
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 | |
- name: Install the latest version of uv | |
uses: astral-sh/setup-uv@v5 | |
- name: Install artisatomic | |
run: | | |
uv sync --frozen | |
source .venv/bin/activate | |
uv pip install --compile-bytecode --editable .[dev] | |
- name: Run Ruff | |
if: always() | |
uses: astral-sh/ruff-action@v2 | |
with: | |
version: 0.8.3 | |
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.3 | |
args: format --check | |
- name: Lint with mypy | |
run: | | |
uv run --frozen mypy --install-types --non-interactive | |
- name: Cache pre-commit | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/pre-commit | |
key: pre-commit-3|${{ hashFiles('.pre-commit-config.yaml') }} | |
- name: Run pre-commit | |
run: | | |
source .venv/bin/activate | |
uv run --frozen -- pre-commit run --all-files --show-diff-on-failure --color=always | |
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 | |
- name: Install the latest version of uv | |
uses: astral-sh/setup-uv@v5 | |
- name: Install artisatomic | |
run: | | |
uv sync --frozen | |
uv pip install --compile-bytecode --editable .[dev] | |
- 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: uv run --frozen python3 -m 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 | |
- name: Install the latest version of uv | |
uses: astral-sh/setup-uv@v5 | |
- name: Install artisatomic | |
run: | | |
uv sync --frozen | |
uv pip install --compile-bytecode --editable .[dev] | |
- 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: 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 . | |
uv run --frozen makeartisatomicfiles -output_folder tests/${{ matrix.testname }}/output | |
- name: Checksum output files | |
working-directory: tests/${{ matrix.testname }}/output | |
run: | | |
cat compositiondata.txt | |
cat *.json | |
echo | |
md5sum *.txt atomic_data_logs/*.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 |