Merge pull request #153 from laeyraud/wip/laeyraud/increase-ui-termin… #29
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: test suite | |
| on: | |
| push: | |
| branches-ignore: | |
| - "gh-readonly-queue/**" | |
| pull_request: | |
| merge_group: | |
| jobs: | |
| test: | |
| name: cargo test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Install build-depends | |
| run: | | |
| sudo apt update | |
| sudo apt install -y protobuf-compiler libudev-dev | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@master # avoid the tag here to prevent dependabot from updating it | |
| with: | |
| toolchain: "1.78" | |
| - run: cargo test --all-targets --all-features | |
| fmt: | |
| name: cargo fmt | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@master # avoid the tag here to prevent dependabot from updating it | |
| with: | |
| toolchain: "1.78" | |
| components: rustfmt | |
| - run: cargo fmt --all --check | |
| clippy: | |
| name: cargo clippy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Install build-depends | |
| run: | | |
| sudo apt update | |
| sudo apt install -y protobuf-compiler libudev-dev | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@master # avoid the tag here to prevent dependabot from updating it | |
| with: | |
| toolchain: "1.78" | |
| components: clippy | |
| - run: cargo clippy --all-targets -- -D warnings | |
| minimal-dependencies: | |
| name: minimal direct dependencies | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Install build-depends | |
| run: | | |
| sudo apt update | |
| sudo apt install -y protobuf-compiler libudev-dev | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@master # avoid the tag here to prevent dependabot from updating it | |
| with: | |
| toolchain: "nightly-2025-02-01" | |
| components: clippy | |
| - run: rm Cargo.lock | |
| - run: cargo check -Z direct-minimal-versions | |
| cargo-deny: | |
| runs-on: ubuntu-22.04 | |
| strategy: | |
| matrix: | |
| checks: | |
| - advisories | |
| - bans licenses sources | |
| # Prevent sudden announcement of a new advisory from failing ci: | |
| continue-on-error: ${{ matrix.checks == 'advisories' }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: EmbarkStudios/cargo-deny-action@v2 | |
| with: | |
| command: check ${{ matrix.checks }} | |
| docker: | |
| name: docker ${{ matrix.binary }} | |
| runs-on: ubuntu-latest | |
| needs: | |
| - test | |
| - fmt | |
| - clippy | |
| - minimal-dependencies | |
| strategy: | |
| matrix: | |
| binary: | |
| - boardswarm | |
| - boardswarm-cli | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Setup Docker buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - uses: actions/checkout@v4 | |
| - name: Extract Docker metadata | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ghcr.io/${{ github.repository }}/${{ matrix.binary }}${{ github.ref != 'refs/heads/main' && '-ci' || '' }} | |
| tags: | | |
| "type=ref,event=branch" | |
| "type=ref,suffix=-{{sha}},event=branch" | |
| "type=ref,suffix=-{{date 'YYYYMMDD'}},event=branch" | |
| "type=ref,event=tag" | |
| "type=ref,event=pr" | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| push: ${{ github.event_name == 'push' }} | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| file: ${{ matrix.binary }}/Dockerfile | |
| allgreen: | |
| if: always() | |
| needs: | |
| - cargo-deny | |
| - test | |
| - fmt | |
| - clippy | |
| - minimal-dependencies | |
| - docker | |
| runs-on: Ubuntu-latest | |
| steps: | |
| - name: Decide whether the needed jobs succeeded or failed | |
| uses: re-actors/alls-green@release/v1 | |
| with: | |
| jobs: ${{ toJSON(needs) }} |