Continuous integration #262
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
| name: Continuous integration | |
| on: | |
| schedule: | |
| - cron: '30 5,17 * * *' | |
| push: | |
| branches: | |
| - '*' | |
| - '!main' | |
| pull_request: | |
| branches: | |
| - 'main' | |
| workflow_dispatch: | |
| concurrency: | |
| group: CI | |
| env: | |
| GIST_KEY: 78aecaf468ab6450fb08dfe0cdaa96de # pragma: allowlist secret | |
| RUST_BACKTRACE: 1 | |
| MINIMUM_WAIT: 3 | |
| MAXIMUM_WAIT: 10 | |
| jobs: | |
| windows-ci: | |
| runs-on: ${{ matrix.os }}-latest | |
| outputs: | |
| result: ${{steps.result.outputs.result}} | |
| strategy: | |
| matrix: | |
| rust: | |
| - stable | |
| - beta | |
| - nightly | |
| - 1.64.0 # MSRV | |
| os: | |
| - windows | |
| include: | |
| - os: windows | |
| logo: windows | |
| - rust: 1.64.0 | |
| label: msrv | |
| - rust: nightly | |
| label: nightly | |
| - rust: beta | |
| label: beta | |
| - rust: stable | |
| label: stable | |
| steps: | |
| - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b | |
| - name: Install Rust | |
| uses: actions-rs/toolchain@b2417cde72dcf67f306c0ae8e0828a81bf0b189f | |
| with: | |
| profile: minimal | |
| toolchain: ${{ matrix.rust }} | |
| override: true | |
| components: rustfmt, clippy | |
| - name: Cache dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| - uses: actions-rs/cargo@ae10961054e4aa8b4aa7dffede299aaf087aa33b | |
| name: Build | |
| with: | |
| command: build | |
| - uses: actions-rs/cargo@ae10961054e4aa8b4aa7dffede299aaf087aa33b | |
| name: Test | |
| with: | |
| command: test | |
| - uses: actions-rs/cargo@ae10961054e4aa8b4aa7dffede299aaf087aa33b | |
| name: Format | |
| with: | |
| command: fmt | |
| args: --all -- --check | |
| - uses: actions-rs/cargo@ae10961054e4aa8b4aa7dffede299aaf087aa33b | |
| name: Lint | |
| with: | |
| command: clippy | |
| args: -- -D warnings | |
| - name: Wait before badge creation | |
| uses: AliSajid/random-wait-action@4223eaaf5f578e1b80d73004fe7e7be9d83ba46e | |
| with: | |
| minimum: ${{ env.MINIMUM_WAIT }} | |
| maximum: ${{ env.MAXIMUM_WAIT }} | |
| - name: Create Awesome Badge - Success | |
| uses: schneegans/dynamic-badges-action@5d424ad4060f866e4d1dab8f8da0456e6b1c4f56 | |
| if: success() | |
| with: | |
| auth: ${{ secrets.GIST_SECRET }} | |
| gistID: ${{ env.GIST_KEY }} | |
| filename: ${{matrix.os}}-${{matrix.label}}.json | |
| label: Build | |
| namedLogo: ${{matrix.logo}} | |
| message: Succeeded | |
| color: green | |
| - name: Create Awesome Badge - Failure | |
| uses: schneegans/dynamic-badges-action@5d424ad4060f866e4d1dab8f8da0456e6b1c4f56 | |
| if: failure() | |
| with: | |
| auth: ${{ secrets.GIST_SECRET }} | |
| gistID: ${{ env.GIST_KEY }} | |
| filename: ${{matrix.os}}-${{matrix.label}}.json | |
| namedLogo: ${{matrix.logo}} | |
| label: Build | |
| message: Failed | |
| isError: true | |
| - name: Set Result | |
| if: always() | |
| run: echo "result=${{ job.status }}" >> $GITHUB_OUTPUT | |
| ubuntu-ci: | |
| runs-on: ${{ matrix.os }}-latest | |
| outputs: | |
| result: ${{steps.result.outputs.result}} | |
| strategy: | |
| matrix: | |
| rust: | |
| - stable | |
| - beta | |
| - nightly | |
| - 1.64.0 # MSRV | |
| os: | |
| - ubuntu | |
| include: | |
| - os: ubuntu | |
| logo: ubuntu | |
| - rust: 1.64.0 | |
| label: msrv | |
| - rust: nightly | |
| label: nightly | |
| - rust: beta | |
| label: beta | |
| - rust: stable | |
| label: stable | |
| steps: | |
| - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b | |
| - uses: actions-rs/toolchain@b2417cde72dcf67f306c0ae8e0828a81bf0b189f | |
| name: Install Rust | |
| with: | |
| profile: minimal | |
| toolchain: ${{ matrix.rust }} | |
| override: true | |
| components: rustfmt, clippy | |
| - name: Cache dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| - uses: actions-rs/cargo@ae10961054e4aa8b4aa7dffede299aaf087aa33b | |
| name: Build | |
| with: | |
| command: build | |
| - uses: actions-rs/cargo@ae10961054e4aa8b4aa7dffede299aaf087aa33b | |
| name: Test | |
| with: | |
| command: test | |
| - uses: actions-rs/cargo@ae10961054e4aa8b4aa7dffede299aaf087aa33b | |
| name: Format | |
| with: | |
| command: fmt | |
| args: --all -- --check | |
| - uses: actions-rs/cargo@ae10961054e4aa8b4aa7dffede299aaf087aa33b | |
| name: Lint | |
| with: | |
| command: clippy | |
| args: -- -D warnings | |
| - name: Wait before badge creation | |
| uses: AliSajid/random-wait-action@4223eaaf5f578e1b80d73004fe7e7be9d83ba46e | |
| with: | |
| minimum: ${{ env.MINIMUM_WAIT }} | |
| maximum: ${{ env.MAXIMUM_WAIT }} | |
| - name: Create Awesome Badge - Success | |
| uses: schneegans/dynamic-badges-action@5d424ad4060f866e4d1dab8f8da0456e6b1c4f56 | |
| if: success() | |
| with: | |
| auth: ${{ secrets.GIST_SECRET }} | |
| gistID: ${{ env.GIST_KEY }} | |
| filename: ${{matrix.os}}-${{matrix.label}}.json | |
| label: Build | |
| namedLogo: ${{matrix.logo}} | |
| message: Succeeded | |
| color: green | |
| - name: Create Awesome Badge - Failure | |
| uses: schneegans/dynamic-badges-action@5d424ad4060f866e4d1dab8f8da0456e6b1c4f56 | |
| if: failure() | |
| with: | |
| auth: ${{ secrets.GIST_SECRET }} | |
| gistID: ${{ env.GIST_KEY }} | |
| filename: ${{matrix.os}}-${{matrix.label}}.json | |
| namedLogo: ${{matrix.logo}} | |
| label: Build | |
| message: Failed | |
| isError: true | |
| - name: Set Result | |
| if: always() | |
| run: echo "result=${{ job.status }}" >> $GITHUB_OUTPUT | |
| macos-ci: | |
| runs-on: ${{ matrix.os }}-latest | |
| outputs: | |
| result: ${{steps.result.outputs.result}} | |
| strategy: | |
| matrix: | |
| rust: | |
| - stable | |
| - beta | |
| - nightly | |
| - 1.64.0 # MSRV | |
| os: | |
| - macos | |
| include: | |
| - os: macos | |
| logo: apple | |
| - rust: 1.64.0 | |
| label: msrv | |
| - rust: nightly | |
| label: nightly | |
| - rust: beta | |
| label: beta | |
| - rust: stable | |
| label: stable | |
| steps: | |
| - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b | |
| - uses: actions-rs/toolchain@b2417cde72dcf67f306c0ae8e0828a81bf0b189f | |
| name: Install Rust | |
| with: | |
| profile: minimal | |
| toolchain: ${{ matrix.rust }} | |
| override: true | |
| components: rustfmt, clippy | |
| - name: Cache dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| - uses: actions-rs/cargo@ae10961054e4aa8b4aa7dffede299aaf087aa33b | |
| name: Build | |
| with: | |
| command: build | |
| - uses: actions-rs/cargo@ae10961054e4aa8b4aa7dffede299aaf087aa33b | |
| name: Test | |
| with: | |
| command: test | |
| - uses: actions-rs/cargo@ae10961054e4aa8b4aa7dffede299aaf087aa33b | |
| name: Format | |
| with: | |
| command: fmt | |
| args: --all -- --check | |
| - uses: actions-rs/cargo@ae10961054e4aa8b4aa7dffede299aaf087aa33b | |
| name: Lint | |
| with: | |
| command: clippy | |
| args: -- -D warnings | |
| - name: Wait before badge creation | |
| uses: AliSajid/random-wait-action@4223eaaf5f578e1b80d73004fe7e7be9d83ba46e | |
| with: | |
| minimum: ${{ env.MINIMUM_WAIT }} | |
| maximum: ${{ env.MAXIMUM_WAIT }} | |
| - name: Create Awesome Badge - Success | |
| id: result | |
| uses: schneegans/dynamic-badges-action@5d424ad4060f866e4d1dab8f8da0456e6b1c4f56 | |
| with: | |
| auth: ${{ secrets.GIST_SECRET }} | |
| gistID: ${{ env.GIST_KEY }} | |
| filename: ${{matrix.os}}-${{matrix.label}}.json | |
| label: Build | |
| namedLogo: ${{matrix.logo}} | |
| message: Succeeded | |
| color: green | |
| - name: Create Awesome Badge - Failure | |
| uses: schneegans/dynamic-badges-action@5d424ad4060f866e4d1dab8f8da0456e6b1c4f56 | |
| if: failure() | |
| with: | |
| auth: ${{ secrets.GIST_SECRET }} | |
| gistID: ${{ env.GIST_KEY }} | |
| filename: ${{matrix.os}}-${{matrix.label}}.json | |
| namedLogo: ${{matrix.logo}} | |
| label: Build | |
| message: Failed | |
| isError: true | |
| - name: Set Result | |
| if: always() | |
| run: echo "result=${{ job.status }}" >> $GITHUB_OUTPUT | |
| semantic-release: | |
| needs: [macos-ci, windows-ci, ubuntu-ci] | |
| uses: ./.github/workflows/release.yaml | |
| secrets: inherit # pragma: allowlist secret | |
| upload-release-artifacts: | |
| needs: [semantic-release] | |
| if: needs.semantic-release.outputs.new_release_published == 'true' | |
| uses: ./.github/workflows/release_upload.yaml | |
| secrets: inherit # pragma: allowlist secret | |
| with: | |
| new_version: ${{ needs.semantic-release.outputs.new_release_version }} | |
| new_release_published: ${{ needs.semantic-release.outputs.new_release_published }} |