Rust #78
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: Rust | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
workflow_dispatch: | |
merge_group: | |
types: [checks_requested] | |
schedule: | |
# Runs at 03:30, every Saturday | |
- cron: "30 3 * * 6" | |
# dispatches build workflow with different permissions | |
jobs: | |
elevated: | |
if: ${{ github.event_name == 'push' }} | |
permissions: | |
contents: write | |
id-token: write | |
attestations: write | |
uses: ./.github/workflows/build.yml | |
with: | |
release: true | |
secrets: inherit | |
normal: | |
if: ${{ github.event_name != 'push' }} | |
uses: ./.github/workflows/build.yml | |
with: | |
release: false | |
secrets: inherit | |
build_result: | |
name: Result | |
runs-on: ubuntu-latest | |
needs: ["elevated", "normal"] | |
if: ${{ always() }} | |
steps: | |
- name: Mark the job as successful | |
if: ${{ !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') }} | |
run: exit 0 | |
- name: Mark the job as unsuccessful | |
if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }} | |
run: exit 1 |