Skip to content

Merge pull request #14 from collabora/wip/refi64/workflows-tags #66

Merge pull request #14 from collabora/wip/refi64/workflows-tags

Merge pull request #14 from collabora/wip/refi64/workflows-tags #66

Workflow file for this run

name: test suite
on:
push:
tags:
- '*'
branches-ignore:
- "gh-readonly-queue/**"
pull_request:
merge_group:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
test:
name: cargo test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@1.66.0
- run: cargo test --all-targets --all-features
fmt:
name: cargo fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@1.66.0
with:
components: rustfmt
- run: cargo fmt --all --check
clippy:
name: cargo clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@1.66.0
with:
components: clippy
- run: cargo clippy --all-targets -- -D warnings
docker-image:
name: Docker image build
runs-on: ubuntu-latest
needs:
- test
- fmt
- clippy
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
file: Dockerfile.latest-snapshots
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
allgreen:
if: always()
needs:
- test
- fmt
- clippy
- docker-image
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) }}