Skip to content

Gravity

Gravity #237

Workflow file for this run

name: Gravity
on:
workflow_run:
workflows: ["Build"]
types:
- completed
jobs:
gravity:
name: Run Gravity
runs-on: ubuntu-latest
if: >
github.event.workflow_run.conclusion == 'success'
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 10
- name: 'Download artifact'
uses: actions/github-script@v6
with:
script: |
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.payload.workflow_run.id,
});
let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => {
return artifact.name == "artifacts"
})[0];
let download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
});
let fs = require('fs');
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/artifacts.zip`, Buffer.from(download.data));
- run: pnpm dlx @gravityci/cli "artifacts" # keep track of the sizes of both the .crate file as well as the binary
env:
GRAVITY_SHA: ${{ github.event.workflow_run.head_sha }}
GRAVITY_PR_ID: ${{ github.event.workflow_run.event == 'pull_request' && github.event.pull_request.id || '' }}
GRAVITY_TOKEN: ${{ secrets.GRAVITY_TOKEN }}