ceremonyclient/crates/ed448-rust/.github/workflows/ci.yml
Cassandra Heart c76c07874f
additional
2025-01-14 00:41:51 -06:00

172 lines
5.0 KiB
YAML

name: Ci
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches:
- main
- dev
pull_request:
branches:
- main
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
check:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout sources
uses: actions/checkout@v2
# Install stable toolchain
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
# Runs the compilation checks
- name: Run cargo check with defaults feature
uses: actions-rs/cargo@v1
with:
command: check
# - name: Run cargo check with all features
# uses: actions-rs/cargo@v1
# with:
# command: check
# args: --all-features
clippy_and_fmt:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout sources
uses: actions/checkout@v2
# Install nightly toolchain
- name: Install nightly toolchain
uses: actions-rs/toolchain@v1
with:
profile: default
toolchain: nightly
override: true
components: clippy, rustfmt
# Checks Rust code formatting
- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
# Checks Rust code with Clippy
- name: Run cargo clippy
uses: actions-rs/cargo@v1
continue-on-error: true # note: the compiler unexpectedly panicked. this is a bug.
with:
command: clippy
args: --all-features -- -D warnings
test:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout sources
uses: actions/checkout@v2
# Install nightly toolchain
- name: Install nightly toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
components: llvm-tools-preview
# Build the binary
- name: Build binary
uses: actions-rs/cargo@v1
with:
command: build
args: --all-features
env:
RUSTFLAGS: "-Zinstrument-coverage"
# Runs the units tests in Debug mode
- name: Execute tests
uses: actions-rs/cargo@v1
with:
command: test
args: --all-features
env:
RUSTFLAGS: "-Zinstrument-coverage"
LLVM_PROFILE_FILE: "your_name-%p-%m.profraw"
RUST_LOG: "ed448_rust"
- name: Install grcov
run: curl -L https://github.com/mozilla/grcov/releases/latest/download/grcov-linux-x86_64.tar.bz2 | tar jxf -
- name: Gather coverage data
run: ./grcov $GITHUB_WORKSPACE --source-dir $GITHUB_WORKSPACE --llvm --commit-sha $GITHUB_SHA --binary-path $GITHUB_WORKSPACE/target/debug/ --output-type lcov --branch --ignore-not-existing --ignore "/*" --output-path $LCOV_DESTINATION --service-name $GITHUB_WORKFLOW
env:
LCOV_DESTINATION: ${{ runner.temp }}/lcov.info
- name: Codecov upload
uses: codecov/codecov-action@v1
with:
#token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
files: ${{ runner.temp }}/lcov.info
name: codecov-ed448-rust # optional
fail_ci_if_error: true # optional (default = false)
build:
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
# The type of runner that the job will run on
runs-on: ${{ matrix.os }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout sources
uses: actions/checkout@v2
# Install stable toolchain
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
# Build the project
- name: Build the project
uses: actions-rs/cargo@v1
with:
command: build
args: --release