Skip to content

Commit

Permalink
ci: add makefile and update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
apollo-sturdy committed Feb 8, 2024
1 parent 341195a commit e7bfb0c
Show file tree
Hide file tree
Showing 13 changed files with 502 additions and 427 deletions.
61 changes: 0 additions & 61 deletions .github/workflows/Basic.yml

This file was deleted.

19 changes: 19 additions & 0 deletions .github/workflows/cc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

name: Conventional commit check
on:
pull_request:
workflow_dispatch:

# This workflow denies a push on a pull request if all pushed commits are not following
# the conventional commits standard.

jobs:
conv-commit:
name: Enforce conventional commit messages
runs-on: ubuntu-latest
steps:
- name: Checkout pull request
uses: actions/checkout@v3

- name: Check all commit messages for adherence
uses: bilalshaikh42/[email protected]
24 changes: 24 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Check for errors
on:
pull_request:
workflow_dispatch:

env:
RUSTFLAGS: -D warnings

jobs:
cargo-check:
name: Cargo check
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Install cargo make
uses: davidB/rust-cargo-make@v1

- name: Install stable Rust
run: cargo make install-stable

- name: Check
run: cargo make check
33 changes: 33 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Coverage

on:
push:
branches:
- master
pull_request:

env:
RUST_BACKTRACE: 1
CARGO_TERM_COLOR: always

jobs:
coverage:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Install cargo make
uses: davidB/rust-cargo-make@v1

- name: Install stable Rust
run: cargo make install-stable

- name: Run test coverage
run: cargo make coverage-lcov

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: target/coverage/lcov.info
34 changes: 34 additions & 0 deletions .github/workflows/licenses.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Check licenses and sources
on:
pull_request:
workflow_dispatch:

env:
RUSTFLAGS: -D warnings

jobs:
cargo-deny:
runs-on: ubuntu-latest
strategy:
matrix:
checks:
- advisories
- bans licenses sources

# Prevent sudden announcement of a new advisory from failing ci:
continue-on-error: ${{ matrix.checks == 'advisories' }}

steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Install cargo make
uses: davidB/rust-cargo-make@v1

- name: Install stable toolchain
run: cargo make install-stable

- name: run cargo deny
uses: EmbarkStudios/cargo-deny-action@v1
with:
command: check ${{ matrix.checks }}
34 changes: 34 additions & 0 deletions .github/workflows/lint-format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Linting and formatting
on:
pull_request:
workflow_dispatch:

env:
RUSTFLAGS: -D warnings

jobs:
lint-and-format:
name: Lint and check formatting
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Install cargo make
uses: davidB/rust-cargo-make@v1

- name: Install nightly toolchain
run: cargo make install-nightly

- name: Run cargo clippy
run: cargo make clippy-check

- name: Run cargo fmt
run: cargo make format-check

- name: Run cargo machete
run: cargo make machete-check

# TODO: Enable when project more mature
# - name: Lint todo comments
# run: cargo make todo-check
32 changes: 32 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Test Suite
on:
pull_request:
workflow_dispatch:

env:
RUSTFLAGS: -D warnings

jobs:
test:
name: Test Suite
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Install cargo make
uses: davidB/rust-cargo-make@v1

- name: Install stable toolchain
run: cargo make install-stable

- name: Run unit tests
run: cargo make unit-test
env:
RUST_BACKTRACE: 1

# No integration tests yet
# - name: Run integration tests
# run: cargo make integration-test
# env:
# RUST_BACKTRACE: 1
Loading

0 comments on commit e7bfb0c

Please sign in to comment.