add binder badge to readme #7342
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: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| jobs: | |
| unit-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.10' | |
| - name: Install PROCESS | |
| # Editable install to match default install | |
| run: | | |
| pip install -e '.[test, examples]' | |
| pip install -r requirements_dev.txt | |
| - name: Run unit tests | |
| run: | | |
| pytest --cov=process tests/unit -v \ | |
| --cov-report xml | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v5 | |
| 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@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.10' | |
| - name: Install PROCESS | |
| # Editable install to match default install | |
| run: | | |
| pip install -e '.[test]' | |
| pip install -r requirements_dev.txt | |
| - name: Install poppler | |
| run: | | |
| sudo apt update | |
| sudo apt install poppler-utils | |
| - name: Run integration tests | |
| run: pytest tests/integration -n auto -v | |
| example-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.10' | |
| - name: Install PROCESS | |
| # Editable install to match default install | |
| run: | | |
| pip install -e '.[test, examples]' | |
| pip install -r requirements_dev.txt | |
| - name: Install poppler | |
| run: | | |
| sudo apt update | |
| sudo apt install poppler-utils | |
| - name: Run example notebook tests | |
| run: pytest tests/examples -n auto -v | |
| regression-test: | |
| runs-on: ubuntu-latest | |
| needs: [tracking] | |
| # depend on make and tracking job but dont skip if tracking was skipped | |
| if: always() | |
| continue-on-error: true | |
| strategy: | |
| matrix: | |
| tolerance: [0, 5] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.10' | |
| - name: Install PROCESS | |
| # Editable install to match default install | |
| run: | | |
| pip install -e '.[test, examples]' | |
| pip install -r requirements_dev.txt | |
| - name: Allow git commands to be run | |
| run: git config --global --add safe.directory '*' | |
| - name: Run regression tests | |
| run: pytest tests/regression -sv --reg-tolerance=${{ matrix.tolerance }} | |
| run-tracking-inputs: | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/main' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.10' | |
| - name: Install PROCESS | |
| run: pip install -e . | |
| - name: Install dev dependencies | |
| run: pip install -r requirements_dev.txt | |
| - name: Run regression input files | |
| 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@v4 | |
| with: | |
| name: tracked-mfiles | |
| path: tracking/*_MFILE.DAT | |
| - name: Archive tracked SIG_TF.json | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: sig-tfs | |
| path: tracking/*.json | |
| pre-commit-quality-check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.10' | |
| - name: Install dev dependencies | |
| run: pip install -r requirements_dev.txt | |
| - name: Run pre-commit | |
| run: pre-commit run --all-files | |
| tracking: | |
| concurrency: | |
| group: tracking-jobs | |
| cancel-in-progress: false | |
| runs-on: ubuntu-latest | |
| needs: run-tracking-inputs | |
| if: github.ref == 'refs/heads/main' | |
| env: | |
| COMMIT_MESSAGE: ${{ github.event.head_commit.message }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.10' | |
| - name: Install PROCESS | |
| run: pip install -e . | |
| - name: Install dev dependencies | |
| run: pip install -r requirements_dev.txt | |
| - name: Setup SSH identity | |
| uses: webfactory/[email protected] | |
| with: | |
| ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
| - name: Download tracking data | |
| run: git clone [email protected]:timothy-nunn/process-tracking-data.git process-tracking-data | |
| - name: Download MFILEs | |
| uses: actions/download-artifact@v4 | |
| 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 '*' | |
| python tracking/run_tracking_inputs.py track process-tracking-data "${MSG}" ${{ github.sha }} | |
| - name: Create the tracking dashboard | |
| run: python tracking/tracking_data.py plot process-tracking-data --out tracking.html | |
| - name: Archive tracking dashboard | |
| uses: actions/upload-artifact@v4 | |
| 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 | |
| needs: tracking | |
| if: github.ref == 'refs/heads/main' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.10' | |
| - name: Install PROCESS | |
| run: pip install -e . | |
| - name: Install dev dependencies | |
| run: pip install -r requirements_dev.txt | |
| - run: python scripts/vardes.py | |
| - run: git config --global --add safe.directory '*' | |
| - name: Download STF_TF.json files | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: sig-tfs | |
| path: tracking/ | |
| - name: Download MFILEs | |
| uses: actions/download-artifact@v4 | |
| 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 proc | |
| run: python process/io/plot_proc.py -f tracking/large_tokamak_nof_MFILE.DAT | |
| - name: Move plot proc file to docs images | |
| run: mv tracking/large_tokamak_nof_MFILE.DATSUMMARY.pdf documentation/images/plot_proc.pdf | |
| - run: mkdocs build | |
| - name: Download tracking html | |
| uses: actions/download-artifact@v4 | |
| 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@v3 | |
| with: | |
| path: site/ | |
| - name: Deploy GitHub pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |