Skip to content

Add carsus

Add carsus #478

Workflow file for this run

---
name: Test
permissions:
contents: read
on:
push:
merge_group:
schedule:
- cron: 0 13 * * 1
workflow_dispatch:
jobs:
lint:
name: Format, lint, and type check
runs-on: ubuntu-24.04
env:
RUFF_OUTPUT_FORMAT: github
UV_FROZEN: 1
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup uv
uses: astral-sh/setup-uv@v6
with:
activate-environment: true
- name: Install artisatomic
run: |
uv sync
source .venv/bin/activate
uv pip install --compile-bytecode --editable .
- name: Run Ruff
if: always()
run: |
uv run -- ruff --version
uv run -- ruff check --exit-non-zero-on-fix --no-fix
- name: Run Ruff Format
if: always()
run: uv run -- ruff format --check --exit-non-zero-on-format
- name: Run ty
if: always()
run: uv run -- ty check
- name: Run pyright
if: always()
run: uv run -- pyright --warnings
- name: Run mypy
if: always()
run: uv run -- mypy
- name: Cache prek
uses: actions/cache@v5
with:
path: ~/.cache/prek
key: prek-3-${{ runner.os }}${{ runner.arch }}-${{ hashFiles('.pre-commit-config.yaml') }}-${{ github.run_id }}
restore-keys: |
prek-3-${{ runner.os }}${{ runner.arch }}-${{ hashFiles('.pre-commit-config.yaml') }}-
prek-3-${{ runner.os }}${{ runner.arch }}-
- name: Run prek
if: always()
run: |
prek install
prek run --all-files --show-diff-on-failure --color=always
pytest:
runs-on: ubuntu-24.04
env:
UV_FROZEN: 1
ARTISATOMIC_TESTMODE: 1
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup uv
uses: astral-sh/setup-uv@v6
with:
activate-environment: true
- name: Install artisatomic
run: |
uv sync
uv pip install --compile-bytecode --editable .
- name: Cache CMFGEN atomic data
uses: actions/cache@v4
id: cache-cmfgendata
with:
path: atomic-data-hillier/atomic_21jun23/**
key: atomic-data-hillier/atomic_data_21jun23/files
- name: Download/extract CMFGEN atomic data
if: ${{ steps.cache-cmfgendata.outputs.cache-hit != 'true' }}
working-directory: atomic-data-hillier/
run: source ./setup_cmfgen_data.sh
- name: Test with pytest
run: uv run python3 -m pytest
tests:
strategy:
matrix:
testname: [cmfgen, floers25, jplt, kurucz, qub]
fail-fast: false
runs-on: ubuntu-24.04
env:
UV_FROZEN: 1
ARTISATOMIC_TESTMODE: 1
timeout-minutes: 45
name: test ${{ matrix.testname }}
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup uv
uses: astral-sh/setup-uv@v6
with:
activate-environment: true
- name: Install artisatomic
run: |
uv sync
uv pip install --compile-bytecode --editable .
- name: Cache CMFGEN atomic data
uses: actions/cache@v4
id: cache-cmfgendata
with:
path: atomic-data-hillier/atomic_21jun23/**
key: atomic-data-hillier/atomic_data_21jun23/files
- name: Download/extract CMFGEN atomic data
if: ${{ steps.cache-cmfgendata.outputs.cache-hit != 'true' }}
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_v2.1/**
key: atomic-data-tanaka-jplt-files-v2.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 -xJvf testdata.tar.xz
- name: Extract QUB test data
if: matrix.testname == 'qub'
working-directory: atomic-data-qub/
run: rsync -av co_tyndall_test_sample/ co_tyndall/
- name: Generate artis atomic data files
run: |
cp tests/${{ matrix.testname }}/artisatomicionhandlers.json .
uv run makeartisatomicfiles -output_folder tests/${{ matrix.testname }}/output
- name: Checksum output files
working-directory: tests/${{ matrix.testname }}/output
run: |
cat compositiondata.txt
cat atomic_data_logs/*.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