Skip to content

ci(crates-io): make crates-io workflow dispatch only #2082

ci(crates-io): make crates-io workflow dispatch only

ci(crates-io): make crates-io workflow dispatch only #2082

Workflow file for this run

name: PR
on:
pull_request:
branches: [master, vara-stage-1, vara-stage-2, vara-stage-3]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_INCREMENTAL: 0
CARGO_TERM_COLOR: always
RUST_BACKTRACE: short
TERM: xterm-256color
BINARYEN_VERSION: version_111
jobs:
status:
runs-on: ubuntu-latest
outputs:
skip-ci: ${{ steps.check-commit-message.outputs.skip-ci }}
cache: ${{ steps.check-commit-message.outputs.cache }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Check Commit Message
id: check-commit-message
run: |
MESSAGE=$(git show -s --format=%s)
CACHE=true
if [[ $MESSAGE == *"[skip-cache]"* ]]; then
CACHE=""
fi
if [[ $MESSAGE == *"[skip-ci]"* ]]; then
echo "skip-ci: 1"
echo "skip-ci=1" >> $GITHUB_OUTPUT
fi
echo "cache: ${CACHE}"
echo "cache=${CACHE}" >> $GITHUB_OUTPUT
- uses: actions/github-script@v7
env:
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
TITLE: ${{ github.event.pull_request.title }}
SKIP_CI: ${{ steps.check-commit-message.outputs.skip-ci }}
with:
script: |
const script = require('./.github/actions/label/skip.js');
await script({ github, core });
- name: Set sccache path
if: ${{ steps.check-commit-message.outputs.cache }}
run: |
sccache_path="/mnt/sccache/$(echo ${GITHUB_REF#refs/heads/} | tr / _)"
echo "cache=$sccache_path" >> $GITHUB_OUTPUT
check:
needs: status
if: >-
!contains(github.event.pull_request.title, '[skip-ci]')
&& needs.status.outputs.skip-ci != '1'
uses: ./.github/workflows/check.yml
with:
cache: ${{ needs.status.outputs.cache }}
build:
needs: status
if: >-
needs.status.outputs.skip-ci != '1'
&& (
(
github.event.pull_request.head.repo.full_name == 'gear-tech/gear'
&& contains(github.event.pull_request.title, '[depbot]')
) || (
contains(github.event.pull_request.labels.*.name, 'A0-pleasereview')
|| contains(github.event.pull_request.labels.*.name, 'A4-insubstantial')
|| contains(github.event.pull_request.labels.*.name, 'A2-mergeoncegreen')
))
uses: ./.github/workflows/build.yml
with:
cache: ${{ needs.status.outputs.cache }}
macos: ${{ contains(github.event.pull_request.labels.*.name, 'E2-forcemacos') }}