Added Discarded state to cf contract #156
Workflow file for this run
This file contains 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: Build Contracts & Schemas | |
on: | |
pull_request: | |
branches: [main, development] | |
workflow_dispatch: | |
inputs: | |
network: | |
description: "Network to deploy to" | |
required: true | |
type: string | |
kernel_address: | |
description: "Kernel address" | |
required: false | |
type: string | |
deploy_os: | |
description: "Deploy OS" | |
required: false | |
type: boolean | |
contracts: | |
description: "Contracts to deploy" | |
required: false | |
type: string | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
name: Contracts | |
if: > | |
!contains(github.event.pull_request.labels.*.name, 'ci: skip-build') | |
steps: | |
- uses: dtolnay/rust-toolchain@v1 | |
with: | |
toolchain: 1.75.0 | |
- run: rustup override set 1.75.0 | |
- run: rustup target add wasm32-unknown-unknown | |
- uses: actions/checkout@v4 | |
- name: Build | |
run: | | |
chmod +x "${GITHUB_WORKSPACE}/scripts/build_all.sh" | |
make build | |
sudo make version-map | |
- name: Check contract sizes | |
run: | | |
chmod +x "${GITHUB_WORKSPACE}/.github/file-size.sh" | |
"${GITHUB_WORKSPACE}/.github/file-size.sh" | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: contracts | |
path: ./artifacts/ | |
if-no-files-found: error | |
build-schemas: | |
runs-on: ubuntu-latest | |
name: Schemas | |
if: > | |
!contains(github.event.pull_request.labels.*.name, 'ci: skip-build') | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build Schema | |
run: | | |
chmod +x "${GITHUB_WORKSPACE}/scripts/build_schema.sh" | |
make schemas | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: schema | |
path: ./schemas/ | |
if-no-files-found: error | |
trigger-deploy: | |
needs: [build, build-schemas] | |
if: github.event_name == 'workflow_dispatch' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Trigger Deploy Workflow | |
uses: actions/github-script@v7 | |
with: | |
github-token: ${{ secrets.CI_PAT }} | |
script: | | |
try { | |
await github.rest.actions.createWorkflowDispatch({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
workflow_id: 'deploy.yml', | |
ref: github.ref, | |
inputs: { | |
network: '${{ inputs.network }}', | |
kernel_address: '${{ inputs.kernel_address }}', | |
deploy_os: '${{ inputs.deploy_os }}', | |
contracts: '${{ inputs.contracts }}' | |
} | |
}); | |
} catch (error) { | |
core.setFailed(`Failed to trigger deploy workflow: ${error.message}`); | |
} |