Remove measurement #719
Workflow file for this run
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: ADJ Validator (and Compact) | |
| on: | |
| push: | |
| pull_request: | |
| jobs: | |
| validate-adj: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install jsonschema | |
| - name: Run ADJ validation | |
| run: | | |
| python3 .github/workflows/scripts/adj-tester/main.py | |
| - name: Notify Slack on failure | |
| if: failure() | |
| env: | |
| SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} | |
| run: | | |
| jq -n \ | |
| --arg repo "${{ github.repository }}" \ | |
| --arg branch "${{ github.ref_name }}" \ | |
| --arg actor "${{ github.actor }}" \ | |
| --arg run_url "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" \ | |
| '{ | |
| text: "<!channel> ❌ ADJ Validator Failed\n\nRepository: \($repo)\nBranch: \($branch)\nActor: \($actor)\n\nWorkflow run:\n\($run_url)" | |
| }' | curl -X POST -H "Content-type: application/json" \ | |
| --data @- \ | |
| $SLACK_WEBHOOK | |
| publish-compact-adj: | |
| needs: validate-adj | |
| runs-on: ubuntu-latest | |
| env: | |
| TARGET_REPO: Hyperloop-UPV/ADJ-Archive | |
| TARGET_BRANCH: main | |
| TARGET_PATH: storage/commit-${{ github.sha }}.json | |
| steps: | |
| - name: Checkout source repository | |
| uses: actions/checkout@v4 | |
| - name: Compact ADJ | |
| run: | | |
| chmod +x .github/workflows/scripts/adj-compact/compact.sh | |
| .github/workflows/scripts/adj-compact/compact.sh "${{ runner.temp }}/adj.json" | |
| - name: Upload to destination repo via API | |
| env: | |
| GH_TOKEN: ${{ secrets.TARGET_REPO_TOKEN }} | |
| run: | | |
| base64 -w0 "${{ runner.temp }}/adj.json" > "${{ runner.temp }}/adj.b64" | |
| jq -n \ | |
| --arg message "chore: add compacted ADJ from ${{ github.repository }}@${{ github.sha }}" \ | |
| --rawfile content "${{ runner.temp }}/adj.b64" \ | |
| --arg branch "$TARGET_BRANCH" \ | |
| '{ | |
| message: $message, | |
| content: $content, | |
| branch: $branch, | |
| committer: {name: "github-actions[bot]", email: "41898282+github-actions[bot]@users.noreply.github.com"}, | |
| author: {name: "github-actions[bot]", email: "41898282+github-actions[bot]@users.noreply.github.com"} | |
| }' \ | |
| > "${{ runner.temp }}/body.json" | |
| curl --fail-with-body -sS -X PUT \ | |
| -H "Authorization: Bearer $GH_TOKEN" \ | |
| -H "Accept: application/vnd.github+json" \ | |
| -H "X-GitHub-Api-Version: 2022-11-28" \ | |
| --data "@${{ runner.temp }}/body.json" \ | |
| "https://api.github.com/repos/${TARGET_REPO}/contents/${TARGET_PATH}" |