Skip to content

Commit

Permalink
Workflow files
Browse files Browse the repository at this point in the history
  • Loading branch information
dcadenas committed Aug 15, 2024
1 parent c6352a2 commit 86fd1a7
Show file tree
Hide file tree
Showing 3 changed files with 131 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -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"
45 changes: 45 additions & 0 deletions .github/workflows/publish-docker-image.yml
Original file line number Diff line number Diff line change
@@ -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 }}
67 changes: 67 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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

0 comments on commit 86fd1a7

Please sign in to comment.