feat: save configs for re-execution on re-starts #2254
This file contains hidden or 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
| --- | |
| # yaml-language-server: $schema=https://raw.githubusercontent.com/SchemaStore/schemastore/refs/heads/master/src/schemas/json/github-workflow.json | |
| name: Workflow - Pull Request Main | |
| # This workflow orchestrates all checks and tests for pull requests | |
| # It uses reusable workflows to keep the configuration DRY | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| branches: [main] | |
| types: [opened, synchronize, reopened, ready_for_review] | |
| # Use concurrency to prevent multiple workflows running on the same PR | |
| concurrency: | |
| group: pr-checks-${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| # ========================================================================= # | |
| # DATABASE # | |
| # ========================================================================= # | |
| # Update database version for schema changes | |
| update-version-db: | |
| if: github.event.pull_request.draft == false | |
| uses: ./.github/workflows/task-ci-version-file.yml | |
| with: | |
| label: db-migration | |
| version-file: .db-versions.yml | |
| secrets: inherit | |
| # ========================================================================= # | |
| # ARTIFACTS # | |
| # ========================================================================= # | |
| # Update artifact version for source changes | |
| update-version-artifacts: | |
| if: github.event.pull_request.draft == false | |
| uses: ./.github/workflows/task-ci-version-file.yml | |
| with: | |
| label: artifacts-update | |
| version-file: .artifact-versions.yml | |
| secrets: inherit | |
| build-artifacts: | |
| needs: update-version-artifacts | |
| uses: ./.github/workflows/task-build-artifacts.yml | |
| with: | |
| should_run: ${{ needs.update-version-artifacts.outputs.update }} | |
| permissions: | |
| contents: read | |
| attestations: write | |
| id-token: write | |
| secrets: inherit | |
| publish-artifacts: | |
| needs: [update-version-artifacts, build-artifacts] | |
| uses: ./.github/workflows/task-publish-image.yml | |
| with: | |
| image-name: artifacts | |
| tag: ${{ needs.build-artifacts.outputs.artifacts }} | |
| tag-version: ${{ needs.build-artifacts.outputs.artifacts-pr }} | |
| should_run: ${{ needs.update-version-artifacts.outputs.update }} | |
| permissions: | |
| contents: read | |
| packages: write | |
| attestations: write | |
| id-token: write | |
| secrets: inherit | |
| # ========================================================================= # | |
| # LINTS # | |
| # ========================================================================= # | |
| # Run Rust-specific linters | |
| lint-rust: | |
| needs: [update-version-db, publish-artifacts] | |
| uses: ./.github/workflows/task-lint-cargo.yml | |
| secrets: inherit | |
| # Run linters for code style and quality | |
| lint-code-style: | |
| needs: [update-version-db, publish-artifacts] | |
| uses: ./.github/workflows/task-lint-code-style.yml | |
| # ========================================================================= # | |
| # MADARA # | |
| # ========================================================================= # | |
| # Build Madara binary | |
| build-madara: | |
| needs: [lint-code-style] | |
| uses: ./.github/workflows/task-build-madara.yml | |
| secrets: inherit | |
| # Run coverage tests | |
| test-madara: | |
| needs: build-madara | |
| uses: ./.github/workflows/task-test-madara.yml | |
| with: | |
| madara-binary-hash: ${{ needs.build-madara.outputs.madara-binary-hash }} | |
| secrets: inherit | |
| # Run JavaScript tests against the built binary | |
| test-js: | |
| needs: build-madara | |
| uses: ./.github/workflows/task-test-js.yml | |
| with: | |
| madara-binary-hash: ${{ needs.build-madara.outputs.madara-binary-hash }} | |
| cairo-artifacts-hash: ${{ needs.build-madara.outputs.cairo-artifacts-hash }} | |
| # Run CLI tests against the built binary | |
| test-cli: | |
| needs: build-madara | |
| uses: ./.github/workflows/task-test-cli.yml | |
| secrets: inherit | |
| # ========================================================================= # | |
| # ORCHESTRATOR # | |
| # ========================================================================= # | |
| # Check Orchestrator binary | |
| # (We don't re-use the Orchestrator binary in other tests) | |
| check-orchestrator: | |
| needs: lint-code-style | |
| uses: ./.github/workflows/task-check-orchestrator.yml | |
| secrets: inherit | |
| # TODO: maybe we can remove the check, if we are building the binary ourselves ? | |
| # Build Orchestrator binary | |
| # build-orchestrator: | |
| # needs: lint-code-style | |
| # uses: ./.github/workflows/task-build-orchestrator.yml | |
| # secrets: inherit | |
| # Run coverage tests | |
| test-orchestrator: | |
| needs: [build-madara, check-orchestrator] | |
| uses: ./.github/workflows/task-test-orchestrator.yml | |
| with: | |
| madara-binary-hash: ${{ needs.build-madara.outputs.madara-binary-hash }} | |
| secrets: inherit | |
| # Run e2e tests | |
| # Disabling for now, will be re-enabled after fixing SNOS multi jobs issue | |
| # e2e-orchestrator: | |
| # needs: [build-madara, check-orchestrator] | |
| # uses: ./.github/workflows/task-e2e-orchestrator.yml | |
| # with: | |
| # madara-binary-hash: ${{ needs.build-madara.outputs.madara-binary-hash }} | |
| # secrets: inherit | |
| # ========================================================================= # | |
| # BOOTSTRAPPER # | |
| # ========================================================================= # | |
| # Deprecating bootstrapper V1 | |
| check-bootstrapper: | |
| needs: lint-code-style | |
| uses: ./.github/workflows/task-do-nothing-check-bootstrapper.yml | |
| secrets: inherit | |
| # Deprecating bootstrapper V1 | |
| # build-bootstrapper: | |
| # needs: lint-code-style | |
| # uses: ./.github/workflows/task-build-bootstrapper.yml | |
| # secrets: inherit | |
| # Deprecating bootstrapper V1 | |
| test-bootstrapper: | |
| if: github.event.pull_request.draft == false | |
| uses: ./.github/workflows/task-do-nothing-test-bootstrapper.yml | |
| # ========================================================================= # | |
| # MERGE QUEUE # | |
| # ========================================================================= # | |
| build-nightly-and-publish-madara: | |
| if: github.event.pull_request.draft == false | |
| uses: ./.github/workflows/task-do-nothing-build-nightly-and-publish.yml | |
| # test-hive: | |
| # uses: ./.github/workflows/task-do-nothing-test-hive.yml | |
| build-nightly-and-publish-orchestrator: | |
| if: github.event.pull_request.draft == false | |
| uses: ./.github/workflows/task-do-nothing-build-nightly-and-publish.yml | |
| build-nightly-and-publish-bootstrapper: | |
| if: github.event.pull_request.draft == false | |
| uses: ./.github/workflows/task-do-nothing-build-nightly-and-publish.yml | |
| test-end-to-end: | |
| if: github.event.pull_request.draft == false | |
| uses: ./.github/workflows/task-do-nothing-test-end-to-end.yml |