Convert costs 2015 to new data structure (#4153) #8582
This file contains hidden or 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: PROCESS main/develop testing | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| env: | |
| python-version: '3.10' | |
| jobs: | |
| unit-test: | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| - name: Setup python and hatch | |
| uses: Fusion-Power-Plant-Framework/fppf-actions/setup-hatch@c6af22fc8d00be67cca53a61177301462f499fb2 | |
| - name: Run unit tests with coverage report | |
| run: | | |
| hatch run test:tests-cov tests/unit | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@fdcc8476540edceab3de004e990f80d881c6cc00 | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| with: | |
| fail_ci_if_error: ${{ github.ref_name == 'main' }} | |
| integration-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| - name: Setup python and hatch | |
| uses: Fusion-Power-Plant-Framework/fppf-actions/setup-hatch@c6af22fc8d00be67cca53a61177301462f499fb2 | |
| with: | |
| python-version: ${{ env.python-version }} | |
| - name: Run integration tests | |
| run: hatch run test.py${{ env.python-version }}:tests-integration | |
| example-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| - name: Setup python and hatch | |
| uses: Fusion-Power-Plant-Framework/fppf-actions/setup-hatch@c6af22fc8d00be67cca53a61177301462f499fb2 | |
| with: | |
| python-version: ${{ env.python-version }} | |
| - name: Run example tests | |
| run: hatch run test.py${{ env.python-version }}:tests-examples | |
| regression-test: | |
| runs-on: ubuntu-latest | |
| needs: [tracking] | |
| # depend on make and tracking job but don't skip if tracking was skipped | |
| # run PROCESS on the regression test input files and compare results to the tracked files | |
| if: always() | |
| continue-on-error: true | |
| strategy: | |
| matrix: | |
| tolerance: [0.2, 5] | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup python and hatch | |
| uses: Fusion-Power-Plant-Framework/fppf-actions/setup-hatch@c6af22fc8d00be67cca53a61177301462f499fb2 | |
| with: | |
| python-version: ${{ env.python-version }} | |
| - name: Run regression tests | |
| run: hatch run test.py${{ env.python-version }}:tests-regression --reg-tolerance=${{ matrix.tolerance }} | |
| run-tracking-inputs: | |
| runs-on: ubuntu-latest | |
| # run PROCESS on the regression test input files and archive output MFILEs | |
| # only runs upon merge to main | |
| if: github.ref == 'refs/heads/main' | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| - name: Setup python and hatch | |
| uses: Fusion-Power-Plant-Framework/fppf-actions/setup-hatch@c6af22fc8d00be67cca53a61177301462f499fb2 | |
| with: | |
| python-version: ${{ env.python-version }} | |
| - name: Run regression input files | |
| run: hatch run python tracking/run_tracking_inputs.py run tests/regression/input_files | |
| - name: Move other files | |
| run: mv tests/regression/input_files/*.json tracking/ | |
| - name: Archive tracked MFILEs | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f | |
| with: | |
| name: tracked-mfiles | |
| path: tracking/*_MFILE.DAT | |
| - name: Archive tracked SIG_TF.json | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f | |
| with: | |
| name: sig-tfs | |
| path: tracking/*.json | |
| pre-commit-quality-check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| - name: Setup python and hatch | |
| uses: Fusion-Power-Plant-Framework/fppf-actions/setup-hatch@c6af22fc8d00be67cca53a61177301462f499fb2 | |
| with: | |
| python-version: ${{ env.python-version }} | |
| - name: Run pre-commit | |
| run: hatch run lint:fmt | |
| tracking: | |
| # update tracker to include the MFILEs created by the run-tracking-inputs job | |
| concurrency: | |
| group: tracking-jobs | |
| cancel-in-progress: false | |
| runs-on: ubuntu-latest | |
| # depends on run-tracking-inputs; only runs upon merge to main | |
| needs: run-tracking-inputs | |
| if: github.ref == 'refs/heads/main' | |
| env: | |
| COMMIT_MESSAGE: ${{ github.event.head_commit.message }} | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| - name: Setup python and hatch | |
| uses: Fusion-Power-Plant-Framework/fppf-actions/setup-hatch@c6af22fc8d00be67cca53a61177301462f499fb2 | |
| with: | |
| python-version: ${{ env.python-version }} | |
| - name: Setup SSH identity | |
| uses: webfactory/ssh-agent@836c84ec59a0e7bc0eabc79988384eb567561ee2 | |
| with: | |
| ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
| - name: Download tracking data | |
| run: git clone git@github.com:timothy-nunn/process-tracking-data.git process-tracking-data | |
| - name: Download MFILEs | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c | |
| with: | |
| name: tracked-mfiles | |
| path: tracking/ | |
| - name: Create new tracking entries | |
| shell: bash | |
| run: | | |
| MSG=$(printf "%q " $COMMIT_MESSAGE) | |
| git config --global --add safe.directory '*' | |
| hatch run python tracking/run_tracking_inputs.py track process-tracking-data "${MSG}" ${{ github.sha }} | |
| - name: Create the tracking dashboard | |
| run: hatch run python tracking/tracking_data.py plot process-tracking-data --out tracking.html | |
| - name: Archive tracking dashboard | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f | |
| with: | |
| name: tracking-html | |
| path: tracking.html | |
| - name: Setup Git identity | |
| run: | | |
| git config --global user.email "${{ github.triggering_actor }}@github.runner" | |
| git config --global user.name "${{ github.job }}" | |
| - name: Commit and push tracking data | |
| run: | | |
| cd process-tracking-data | |
| git add . | |
| git commit -m "${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}" | |
| git push | |
| docs: | |
| concurrency: | |
| group: docs-jobs | |
| cancel-in-progress: false | |
| runs-on: ubuntu-latest | |
| # depends on tracking; only runs upon merge to main | |
| needs: tracking | |
| if: github.ref == 'refs/heads/main' | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup python and hatch | |
| uses: Fusion-Power-Plant-Framework/fppf-actions/setup-hatch@c6af22fc8d00be67cca53a61177301462f499fb2 | |
| with: | |
| python-version: ${{ env.python-version }} | |
| - run: git config --global --add safe.directory '*' | |
| - name: Download STF_TF.json files | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c | |
| with: | |
| name: sig-tfs | |
| path: tracking/ | |
| - name: Download MFILEs | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c | |
| with: | |
| name: tracked-mfiles | |
| path: tracking/ | |
| - run: mv tracking/large_tokamak_nof.SIG_TF.json tracking/large_tokamak_nof_SIG_TF.json | |
| - name: Create an example plot summary | |
| run: hatch run process plot summary -f tracking/large_tokamak_nof_MFILE.DAT | |
| - name: Move plot summary file to docs images | |
| run: mv tracking/large_tokamak_nof_MFILE.DATSUMMARY.pdf documentation/source/images/plot_summary.pdf | |
| - run: hatch run docs:build | |
| - name: Download tracking html | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c | |
| with: | |
| name: tracking-html | |
| - run: mv tracking.html site || cp site/404.html site/tracking.html | |
| - name: Upload documentation page | |
| uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b | |
| with: | |
| path: site/ | |
| - name: Deploy GitHub pages | |
| id: deployment | |
| uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e |