-
-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
186a4d1
commit 94e837f
Showing
77 changed files
with
1,515 additions
and
1,026 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
name: tardis-carsus-bridge | ||
|
||
on: | ||
on: | ||
workflow_call: # to be called by save_atomic_files workflow | ||
outputs: | ||
ref-check-trig: | ||
value: ${{ jobs.tardis-build.outputs.step-ref-check-trig}} | ||
workflow_dispatch: # for running manually | ||
|
||
|
||
env: | ||
XUVTOP: /tmp/chianti | ||
CHIANTI_DL_URL: https://download.chiantidatabase.org | ||
|
@@ -17,9 +17,9 @@ env: | |
CMFGEN_DB_VER: atomic_data_15nov16.tar.gz | ||
# original reference data | ||
REF1_PATH: ${{ github.workspace }}/tardis-refdata/unit_test_data_org.h5 | ||
# generated reference data using the new atomic file | ||
# generated reference data using the new atomic file | ||
REF2_PATH: ${{ github.workspace }}/tardis-refdata/unit_test_data.h5 | ||
PYTEST_FLAGS: --tardis-refdata=${{ github.workspace }}/tardis-refdata | ||
PYTEST_FLAGS: --tardis-refdata=${{ github.workspace }}/tardis-refdata | ||
--generate-reference | ||
CACHE_NUMBER: 1 | ||
|
||
|
@@ -34,7 +34,7 @@ jobs: | |
- uses: actions/checkout@v2 | ||
with: | ||
path: carsus/ | ||
|
||
- uses: actions/cache@v3 | ||
with: | ||
path: ${{ env.XUVTOP }} | ||
|
@@ -47,7 +47,7 @@ jobs: | |
wget -q ${{ env.CHIANTI_DL_URL }}/${{ env.CHIANTI_DB_VER }} -O ${{ env.XUVTOP }}/chianti.tar.gz | ||
tar -zxf ${{ env.XUVTOP }}/chianti.tar.gz -C ${{ env.XUVTOP }} | ||
if: steps.chianti-cache.outputs.cache-hit != 'true' | ||
|
||
- uses: actions/cache@v3 | ||
with: | ||
path: /tmp/atomic | ||
|
@@ -65,7 +65,7 @@ jobs: | |
environment-file: conda-lock.yml | ||
init-shell: bash | ||
cache-environment: true | ||
cache-downloads: true | ||
cache-downloads: true | ||
environment-name: carsus | ||
|
||
- name: Install package | ||
|
@@ -76,13 +76,13 @@ jobs: | |
jupyter nbconvert ${{ env.NBCONVERT_FLAGS }} carsus/docs/tardis_atomdata_ref.ipynb | ||
env: | ||
CARSUS_REFDATA: ${{ github.workspace }}/carsus-refdata | ||
|
||
- name: Upload Atom Data | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: atom-data | ||
path: carsus/docs/kurucz_cd23_chianti_H_He.h5 | ||
|
||
tardis-build: | ||
needs: carsus-build | ||
runs-on: ubuntu-latest | ||
|
@@ -93,10 +93,10 @@ jobs: | |
- uses: actions/checkout@v2 | ||
with: | ||
repository: tardis-sn/tardis | ||
|
||
- name: Download refdata_compare notebook | ||
run: wget https://raw.githubusercontent.com/tardis-sn/tardis-refdata/master/notebooks/ref_data_compare_from_paths.ipynb | ||
|
||
- name: Clone tardis-sn/tardis-refdata | ||
uses: actions/checkout@v2 | ||
with: | ||
|
@@ -109,6 +109,7 @@ jobs: | |
|
||
- name: Restore LFS cache | ||
uses: actions/cache@v3 | ||
id: lfs-cache | ||
with: | ||
path: tardis-refdata/.git/lfs | ||
key: ${{ runner.os }}-lfs-${{ hashFiles('tardis-refdata/.lfs-assets-id') }}-v${{ env.CACHE_NUMBER }} | ||
|
@@ -139,32 +140,32 @@ jobs: | |
|
||
- name: Install package | ||
run: pip install -e . | ||
|
||
- name: Download atom data | ||
uses: actions/[email protected] | ||
with: | ||
name: atom-data | ||
path: carsus/docs/kurucz_cd23_chianti_H_He.h5 | ||
|
||
- name: Replace Atomic Data | ||
run: cp carsus/docs/kurucz_cd23_chianti_H_He.h5/kurucz_cd23_chianti_H_He.h5 tardis-refdata/atom_data/kurucz_cd23_chianti_H_He.h5 | ||
|
||
- name: Generate Reference Data Copy | ||
run: cp tardis-refdata/unit_test_data.h5 tardis-refdata/unit_test_data_org.h5 | ||
run: cp tardis-refdata/unit_test_data.h5 tardis-refdata/unit_test_data_org.h5 | ||
|
||
- name: Generate New Reference Data | ||
run: pytest tardis ${{ env.PYTEST_FLAGS }} | ||
|
||
- name: Compare Reference Data | ||
run: | | ||
jupyter nbconvert ${{ env.NBCONVERT_FLAGS }} ref_data_compare_from_paths.ipynb | ||
- name: Upload comparison notebook | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: Comparison Notebook | ||
path: ref_data_compare_from_paths.html | ||
|
||
- name: Check if reference data are equal | ||
id: ref-equal-check | ||
continue-on-error: true | ||
|
@@ -173,7 +174,7 @@ jobs: | |
# continue-on-error check would display a green tick even when the step passes | ||
# but is necessary for other steps to run | ||
# if the workflow was called by save-atomic-files workflow(the only other option) | ||
# and refdata comparison failed this workflow would pass but the | ||
# and refdata comparison failed this workflow would pass but the | ||
# bridge-ref-check job in save-atomic-files about refdata comparison would fail | ||
- name: Fail the workflow if reference data check fails | ||
if: github.event_name == 'workflow_dispatch' && steps.ref-equal-check.outcome == 'failure' | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ defaults: | |
shell: bash -l {0} | ||
|
||
jobs: | ||
ruff: | ||
ruff: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
@@ -31,13 +31,13 @@ jobs: | |
|
||
- name: Download Lock File | ||
run: wget -q https://raw.githubusercontent.com/tardis-sn/tardis/master/conda-linux-64.lock | ||
|
||
- name: Generate Cache Key | ||
run: | | ||
run: | | ||
file_hash=$(cat conda-linux-64.lock | shasum -a 256 | cut -d' ' -f1) | ||
echo "file_hash=$file_hash" >> "${GITHUB_OUTPUT}" | ||
id: cache-environment-key | ||
|
||
- uses: mamba-org/setup-micromamba@v1 | ||
with: | ||
environment-file: conda-linux-64.lock | ||
|
@@ -46,19 +46,19 @@ jobs: | |
environment-name: tardis | ||
cache-environment: true | ||
cache-downloads: true | ||
|
||
- name: Show statistics pull request | ||
if: github.event_name == 'pull_request_target' | ||
run: ruff check --statistics --show-fixes $(git --no-pager diff --name-only origin/master HEAD --) | tee ruff_stats.txt | ||
|
||
- name: Show entire output pull request | ||
if: github.event_name == 'pull_request_target' | ||
run: ruff check --output-format=concise $(git --no-pager diff --name-only origin/master HEAD --) | tee ruff_full.txt | ||
|
||
- name: Show statistics push | ||
if: github.event_name == 'push' | ||
run: ruff check --statistics --show-fixes . | tee ruff_stats.txt | ||
|
||
- name: Show entire output push | ||
if: github.event_name == 'push' | ||
run: ruff check --output-format=concise . | tee ruff_full.txt | ||
|
@@ -70,19 +70,19 @@ jobs: | |
path: ruff_stats.txt | ||
|
||
- name: Entire output read | ||
id: ruff_complete | ||
id: ruff_complete | ||
uses: juliangruber/[email protected] | ||
with: | ||
path: ruff_full.txt | ||
|
||
- name: Find Comment | ||
if: always() && github.event_name == 'pull_request_target' | ||
uses: peter-evans/find-comment@v1 | ||
id: fc | ||
with: | ||
issue-number: ${{ github.event.number }} | ||
body-includes: I ran ruff on the latest commit | ||
|
||
- name: Post comment | ||
if: github.event_name == 'pull_request_target' | ||
uses: peter-evans/create-or-update-comment@v2 | ||
|
@@ -93,10 +93,10 @@ jobs: | |
edit-mode: replace | ||
body: | | ||
*\*beep\* \*bop\** | ||
Hi human, | ||
I ran ruff on the latest commit (${{ github.event.pull_request.head.sha }}). | ||
Hi human, | ||
I ran ruff on the latest commit (${{ github.event.pull_request.head.sha }}). | ||
Here are the outputs produced. | ||
Results can also be downloaded as artifacts [**here**](${{ env.URL }}). | ||
Results can also be downloaded as artifacts [**here**](${{ env.URL }}). | ||
Summarised output: | ||
<details> | ||
|
@@ -112,16 +112,16 @@ jobs: | |
```diff | ||
${{ steps.ruff_complete.outputs.content }} | ||
``` | ||
</details> | ||
env: | ||
URL: https://github.com/${{ github.repository_owner }}/${{ github.event.repository.name }}/actions/runs/${{ github.run_id }}?check_suite_focus=true | ||
|
||
- name: Save results artifact | ||
uses: actions/upload-artifact@v4 | ||
if: always() | ||
with: | ||
name: ruff-results | ||
path: | | ||
ruff_full.txt | ||
ruff_stats.txt | ||
ruff_stats.txt |
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
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
Oops, something went wrong.