diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..f024407 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,19 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file + +version: 2 +updates: + - package-ecosystem: "cargo" + directory: "/" + schedule: + interval: "weekly" + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "monthly" + - package-ecosystem: "docker" + directory: "/" + schedule: + interval: "monthly" diff --git a/.github/workflows/publish-docker-image.yml b/.github/workflows/publish-docker-image.yml new file mode 100644 index 0000000..9321026 --- /dev/null +++ b/.github/workflows/publish-docker-image.yml @@ -0,0 +1,45 @@ +name: Build and Publish Docker image + +on: + push: + branches: ['main'] + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + push_to_registry: + name: Push Docker image to ghcr registry + runs-on: ubuntu-latest + permissions: + packages: write + contents: read + + steps: + - name: Check out the repo + uses: actions/checkout@v4 + + - name: Log in to the Github Container registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@a64d0487d7069df33b279515d35d60fa80e2ea62 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=ref,event=branch,suffix=_{{sha}} + type=raw,value=latest,enable={{is_default_branch}} + + - name: Build and push Docker images + uses: docker/build-push-action@v6 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml new file mode 100644 index 0000000..d945508 --- /dev/null +++ b/.github/workflows/rust.yml @@ -0,0 +1,67 @@ +on: [push, pull_request] + +name: Code coverage with grcov +env: + CARGO_TERM_COLOR: always + + +jobs: + grcov: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: + - ubuntu-latest + - macOS-latest + + steps: + - uses: actions/checkout@v4 + + - name: Install toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + override: true + profile: minimal + + - name: Clean previous build artifacts + uses: actions-rs/cargo@v1 + with: + command: clean + + - name: Execute tests + uses: actions-rs/cargo@v1 + with: + command: test + args: --all-features --no-fail-fast + env: + CARGO_INCREMENTAL: 0 + RUSTFLAGS: >- + -Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code + -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests + RUSTDOCFLAGS: >- + -Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code + -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests + + - name: Gather coverage data + uses: actions-rs/grcov@v0.1 + with: + config: ./grcov.yml + + - name: Coveralls upload + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + path-to-lcov: ./lcov.info + flag-name: run-${{ matrix.os }} + parallel: true + + grcov_finalize: + needs: grcov + runs-on: ubuntu-latest + steps: + - name: Coveralls finalization + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + parallel-finished: true