Package #91
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: Package | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| commit: | |
| description: Commit SHA associated with the data | |
| required: true | |
| type: string | |
| branch: | |
| description: Branch name associated with the data | |
| required: true | |
| type: string | |
| artifact_id: | |
| description: ID of the artifact | |
| required: true | |
| type: string | |
| repository: | |
| description: Name of the repository | |
| required: true | |
| type: string | |
| run_id: | |
| description: ID of the run | |
| required: true | |
| type: string | |
| platform: | |
| description: Platform of the run | |
| required: false | |
| type: string | |
| default: windows | |
| architecture: | |
| description: Architecture of the run | |
| required: false | |
| type: string | |
| default: x86_64 | |
| # multiple jobs cannot run concurrently due to the reliance on the checkout + generating the output | |
| concurrency: | |
| group: global-lock | |
| cancel-in-progress: false | |
| jobs: | |
| package: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 # needed as there might be new commits coming in from elsewhere | |
| - uses: actions/download-artifact@v5 | |
| with: | |
| github-token: ${{ secrets.PARADIGM_ENGINE_PAT }} # actions:read on the source repo | |
| repository: ${{ github.event.inputs.repository }} | |
| run-id: ${{ github.event.inputs.run_id }} | |
| artifact-ids: ${{ github.event.inputs.artifact_id }} | |
| path: ./temp/ | |
| - name: Download and Prepare Data | |
| run: | | |
| mkdir -p ./data/${{ github.event.inputs.platform }}/${{ github.event.inputs.architecture }}/${{ github.event.inputs.branch }} | |
| mv ./temp/results.json ./data/${{ github.event.inputs.platform }}/${{ github.event.inputs.architecture }}/${{ github.event.inputs.branch }}/${{ github.event.inputs.commit }}.json | |
| rm -rf ./temp/ | |
| - name: Setup Python Deps | |
| run: | | |
| python3 -m pip install --upgrade pip | |
| pip3 install pandas plotly | |
| - name: Add Benchmark to Database | |
| run: | | |
| git pull --rebase origin main | |
| python3 ./src/plot_benchmark.py --add ./data/${{ github.event.inputs.platform }}/${{ github.event.inputs.architecture }}/${{ github.event.inputs.branch }}/${{ github.event.inputs.commit }}.json "${{ github.event.inputs.commit }}" "${{ github.event.inputs.branch }}" "${{ github.event.inputs.platform }}" "${{ github.event.inputs.architecture }}" | |
| - name: Commit Changes | |
| run: | | |
| git config --global user.email "action@github.com" | |
| git config --global user.name "GitHub Action" | |
| git add ./data/${{ github.event.inputs.platform }}/${{ github.event.inputs.architecture }}/${{ github.event.inputs.branch }}/${{ github.event.inputs.commit }}.json | |
| git add ./data/database.db | |
| git commit -m "Added ${{ github.event.inputs.branch }} - ${{ github.event.inputs.commit }} to the data" | |
| git pull --rebase origin main | |
| git push | |
| - uses: actions/github-script@v7 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| await github.rest.actions.createWorkflowDispatch({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| workflow_id: "deploy.yml", | |
| ref: context.ref | |
| }) |