Permit running scorecard workflow manually #1063
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: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
schedule: | |
- cron: 45 3 * * 2 # every Tuesday at 3:45 UTC | |
concurrency: | |
group: ci-${{ github.ref }} | |
cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
permissions: {} | |
jobs: | |
checks: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Compute the checks for ${{ github.event_name }} | |
id: checks | |
run: | | |
x() { | |
local check=$1 | |
while [[ $# -gt 1 ]]; do | |
shift | |
if [[ $1 == ${{ github.event_name }} ]]; then | |
[[ -z "$CHECKS" ]] || CHECKS+=', ' | |
CHECKS+="\"$check\"" | |
fi | |
done | |
true | |
} | |
x copyright pull_request | |
x changelog pull_request | |
x sync pull_request push schedule | |
x publish pull_request push schedule | |
x taplo pull_request push schedule | |
x applets pull_request push schedule | |
x runners pull_request push schedule | |
x tests-0 pull_request push schedule | |
x tests-1 pull_request push schedule | |
x tests-2 pull_request push schedule | |
x hw-host pull_request push schedule | |
x book pull_request push schedule | |
x footprint pull_request push | |
echo "checks=[$CHECKS]" >> $GITHUB_OUTPUT | |
outputs: | |
checks: ${{ steps.checks.outputs.checks }} | |
cache: | |
runs-on: ubuntu-latest | |
needs: checks | |
steps: | |
- uses: actions/checkout@v4 | |
- if: github.event_name != 'schedule' | |
id: cache | |
name: Restore and save the cache | |
uses: ./.github/actions/ci-cache | |
with: | |
mode: save | |
- if: steps.cache.outputs.cache-hit != 'true' | |
name: Run all checks ${{ needs.checks.outputs.checks }} | |
uses: ./.github/actions/ci-checks | |
with: | |
checks: ${{ needs.checks.outputs.checks }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
use-cache: 'false' | |
- if: steps.cache.outputs.cache-hit != 'true' | |
run: rm -rf target && cargo xtask help | |
matrix: | |
runs-on: ubuntu-latest | |
needs: [checks, cache] # The cache is used by the checks. | |
strategy: | |
matrix: | |
check: ${{ fromJSON(needs.checks.outputs.checks) }} | |
name: ${{ matrix.check }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run the ${{ matrix.check }} check | |
uses: ./.github/actions/ci-checks | |
with: | |
checks: "[\"${{ matrix.check }}\"]" | |
token: ${{ secrets.GITHUB_TOKEN }} | |
ubuntu: | |
runs-on: ubuntu-latest | |
needs: matrix | |
steps: | |
- run: true |