Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(fix): modernise CI and remove warnings #67

Merged
merged 3 commits into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
10 changes: 7 additions & 3 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
---
name: Security audit
on:

'on':
push:
pull_request:
schedule:
- cron: "43 04 * * *"

jobs:
security_audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/audit-check@v1
- uses: actions/checkout@v4

- uses: rustsec/audit-check@v1.4.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
81 changes: 43 additions & 38 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,75 +1,80 @@
---
name: CI

on: [push, pull_request]
'on': [push, pull_request]

env:
toolchain: nightly-2022-11-03

jobs:
clippy:
name: clippy
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: "true"

- name: toolchain
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@nightly
with:
toolchain: nightly-2022-11-03
profile: minimal
toolchain: ${{ env.toolchain }}
components: rustfmt, clippy
override: true
- uses: Swatinem/rust-cache@v1

- name: Cache rust dependencies
uses: Swatinem/rust-cache@v2

- name: cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: install cargo lints
uses: actions-rs/cargo@v1
with:
command: install
args: cargo-lints
- name: cargo lints clippy
uses: actions-rs/cargo@v1
with:
command: lints
args: clippy
run: |
cargo +${{ env.toolchain }} fmt --all -- --check

- name: Install cargo-lints
run: |
cargo install cargo-lints

- name: Clippy check (with lints)
run: |
cargo lints clippy --all-targets --all-features

build:
name: build
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: "true"

- name: toolchain
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
profile: minimal
override: true
- uses: Swatinem/rust-cache@v1

- name: Cache rust dependencies
uses: Swatinem/rust-cache@v2

- name: cargo build
uses: actions-rs/cargo@v1
with:
command: build
args: --release
run: |
cargo build --release

test:
name: test
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: "true"

- name: toolchain
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
profile: minimal
override: true
- uses: Swatinem/rust-cache@v1

- name: Cache rust dependencies
uses: Swatinem/rust-cache@v2

- name: cargo test
uses: actions-rs/cargo@v1
with:
command: test
run: |
cargo test
21 changes: 15 additions & 6 deletions .github/workflows/cov.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,48 @@
---
name: Coverage
on:

'on':
push:
branches:
- development
- cov-*

env:
RUSTUP_TOOLCHAIN: "nightly"

jobs:
coverage:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: "true"

- name: Install dependencies
run: |
sudo apt update
sudo apt install -y jq lcov
- name: Download Rust
uses: actions-rs/toolchain@v1
sudo apt install --no-install-recommends --assume-yes \
jq lcov

- name: toolchain
uses: dtolnay/rust-toolchain@nightly
with:
toolchain: nightly
override: true
components: llvm-tools-preview

- name: Install requirements for code coverage
run: |
cargo install cargo-binutils
cargo install rustfilt

- name: Run test coverage
id: coverage
env:
SKIP_HTML: "1"
run: |
/bin/bash -c ./code_coverage.sh

- name: Coveralls upload
uses: coverallsapp/github-action@master
with:
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/pr_title.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
name: PR
on:

'on':
pull_request:
types:
- opened
Expand All @@ -15,6 +17,9 @@ jobs:
run: |
npm install -g @commitlint/cli @commitlint/config-conventional
echo "module.exports = {extends: ['@commitlint/config-conventional']}" > commitlint.config.js

- name: lint
env:
PR_TITLE: ${{github.event.pull_request.title}}
run: |
echo "${{github.event.pull_request.title}}" | commitlint
echo "$PR_TITLE" | commitlint