Run tests #769
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: Run tests | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "0 2 * * *" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/master' || github.run_number }} | |
| cancel-in-progress: true | |
| jobs: | |
| generate_matrix: | |
| name: "Prepare Tests" | |
| runs-on: ubuntu-latest | |
| outputs: | |
| matrix: ${{ steps.set-matrix.outputs.matrix }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - id: set-matrix | |
| run: | | |
| set -e | |
| echo "matrix={\"node\":[$(python getter.py)]}" >> $GITHUB_OUTPUT | |
| run_notebook: | |
| needs: | |
| - generate_matrix | |
| name: "Run tests" | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: ${{fromJSON(needs.generate_matrix.outputs.matrix)}} | |
| timeout-minutes: 60 | |
| steps: | |
| - name: "Set Up Julia" | |
| uses: julia-actions/setup-julia@v2 | |
| with: | |
| version: "1.10" | |
| - uses: julia-actions/cache@v2 | |
| with: | |
| cache-name: julia-cache;workflow=${{ github.workflow }};ref=${{ github.run_id }} | |
| include-matrix: false | |
| - uses: actions/checkout@v4 | |
| - name: "Install Jupyter" | |
| run: | | |
| if (( $(echo "$(pip --version | awk '{print $2}' | cut -d'.' -f 1,2) >= 23.1" |bc -l) )); then | |
| FLAG='--break-system-packages' | |
| else | |
| FLAG='' | |
| fi | |
| pip3 install $FLAG notebook jupytext | |
| - name: "Install julia pre-requisites" | |
| run: | | |
| julia -e ' | |
| using Pkg | |
| Pkg.add(name="IJulia", version="1.31.1") | |
| Pkg.add([ | |
| "Oscar", | |
| "BenchmarkTools", | |
| "GraphRecipes", | |
| "Graphs", | |
| "Interact", | |
| "Plots", | |
| ])' | |
| - run: mkdir -pv notebooks | |
| - run: python3 tester.py ${{ matrix.node }} | |
| - name: Sanitize artifact name | |
| id: sanitize | |
| run: | | |
| SAFE_NAME="${{ matrix.node }}" | |
| SAFE_NAME="${SAFE_NAME//\//_}" | |
| echo "safe_name=$SAFE_NAME" >> "$GITHUB_OUTPUT" | |
| - name: Upload new notebook | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ steps.sanitize.outputs.safe_name }} | |
| path: notebooks/*.ipynb | |
| retention-days: 7 | |
| - name: Notify Slack Action | |
| if: always() | |
| uses: ravsamhq/[email protected] | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| status: ${{ job.status }} | |
| message_format: "{emoji} *${{matrix.node}}* {status_message} in <{run_url}>" | |
| notify_when: "failure,cancelled,skipped" | |
| env: | |
| SLACK_WEBHOOK_URL: ${{ secrets.ACTION_MONITORING_SLACK }} |