Skip to content

Commit

Permalink
Merge pull request #32 from frack113/ci/refactor
Browse files Browse the repository at this point in the history
Ci/refactor
  • Loading branch information
AntwortEinesLebens authored Aug 28, 2024
2 parents 7e32479 + 11345c5 commit a5a8c0e
Show file tree
Hide file tree
Showing 10 changed files with 250 additions and 46 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/audit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
# SPDX-FileCopyrightText: 2023 The WAG development team
#
# SPDX-License-Identifier: CC0-1.0
name: Audit the project
on: [push, pull_request]
jobs:
cargo-deny:
name: Audit with cargo-deny
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Audit Rust code
uses: EmbarkStudios/cargo-deny-action@v1
with:
command: check advisories
43 changes: 43 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
# SPDX-FileCopyrightText: 2023 The WAG development team
#
# SPDX-License-Identifier: CC0-1.0
name: Build and test the project
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
rust:
name: Build Rust code
runs-on: windows-latest
env:
CARGO_TERM_COLOR: always
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Add caching
uses: Swatinem/rust-cache@v2
- name: Build Rust code
run: cargo build -v --workspace --all-targets --all-features
- name: Run Rust tests
run: cargo test -v --workspace --all-targets --all-features
msrv:
name: Check MSRV
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install cargo-hack
uses: taiki-e/install-action@cargo-hack
- name: Check MSRV
run: |-
cargo hack check `
-v `
--rust-version `
--workspace `
--all-targets `
--all-features
59 changes: 59 additions & 0 deletions .github/workflows/format.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
# SPDX-FileCopyrightText: 2023 The WAG development team
#
# SPDX-License-Identifier: CC0-1.0
name: Check formatting of the project
on: [push, pull_request]
jobs:
yamlfix:
name: Check YAML formatting
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v5
with:
cache: pip
- name: Install yamlfix
run: pip install yamlfix
- name: Check YAML formatting
run: yamlfix -v --check .
mdformat:
name: Check Markdown formatting
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v5
with:
cache: pip
- name: Install Mdformat
run: pip install mdformat
- name: Check Markdown formatting
run: mdformat --check .
rustfmt:
name: Check Rust formatting
runs-on: ubuntu-latest
env:
CARGO_TERM_COLOR: always
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install rustfmt
uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- name: Check Rust formatting
run: cargo fmt -v --all -- --check
taplo:
name: Check TOML formatting
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install taplo
uses: uncenter/setup-taplo@v1
- name: Check TOML formatting
run: taplo format --check --verbose
92 changes: 92 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
---
# SPDX-FileCopyrightText: 2023 The WAG development team
#
# SPDX-License-Identifier: CC0-1.0
name: Lint the project
on: [push, pull_request]
env:
CARGO_TERM_COLOR: always
jobs:
yamllint:
name: Lint with yamllint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v5
with:
cache: pip
- name: Install yamllint
run: pip install yamllint
- name: Check YAML formatting
run: yamllint -s .
reuse:
name: Lint with REUSE
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Lint licenses
uses: fsfe/reuse-action@v3
markdownlint-cli2:
name: Lint with markdownlint-cli2
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Lint Markdown code
uses: DavidAnson/markdownlint-cli2-action@v16
clippy:
name: Lint with Clippy
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Clippy
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Add caching
uses: Swatinem/rust-cache@v2
- name: Lint Rust code
run: |-
cargo clippy `
--workspace `
--all-targets `
--all-features `
-- -D warnings
cargo-deny:
name: Lint with cargo-deny
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Lint Rust code
uses: EmbarkStudios/cargo-deny-action@v1
with:
command: check bans licenses sources
cargo-outdated:
name: Lint with cargo-outdated
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Add caching
uses: Swatinem/rust-cache@v2
- name: Install cargo-outdated
run: cargo install --locked cargo-outdated
- name: Lint Rust code
run: cargo outdated -v --exit-code 1 -R -w
taplo:
name: Lint with taplo
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install taplo
uses: uncenter/setup-taplo@v1
- name: Lint TOML code
run: taplo lint --verbose **.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
---
# SPDX-FileCopyrightText: 2023 The WAG development team
#
# SPDX-License-Identifier: CC0-1.0

name: Create new release

on:
push:
tag:
- "v**"

tags: ['**']
jobs:
github:
name: Create a Github release
Expand All @@ -28,7 +25,7 @@ jobs:
uses: softprops/action-gh-release@v2
with:
body_path: CHANGELOG.md
crates.io:
crates-io:
name: Publish to crates.io
runs-on: windows-latest
steps:
Expand Down
15 changes: 0 additions & 15 deletions .github/workflows/reuse.yml

This file was deleted.

25 changes: 0 additions & 25 deletions .github/workflows/rust.yml

This file was deleted.

9 changes: 9 additions & 0 deletions .markdownlint-cli2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
# SPDX-FileCopyrightText: 2023 The WAG development team
#
# SPDX-License-Identifier: CC0-1.0
config:
first-line-h1: false
no-inline-html: false
gitignore: true
globs: ['**.md']
8 changes: 8 additions & 0 deletions .yamllint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
# SPDX-FileCopyrightText: 2023 The WAG development team
#
# SPDX-License-Identifier: CC0-1.0
extends: default
rules:
truthy:
check-keys: false
19 changes: 19 additions & 0 deletions deny.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# SPDX-FileCopyrightText: 2023 The WAG development team
#
# SPDX-License-Identifier: CC0-1.0

[graph]
targets = ["x86_64-pc-windows-msvc"]
all-features = true

[licenses]
confidence-threshold = 1.0
allow = ["Apache-2.0", "MIT", "Unicode-DFS-2016"]

[bans]
multiple-versions = "deny"
multiple-versions-include-dev = true

[sources]
unknown-registry = "deny"
unknown-git = "deny"

0 comments on commit a5a8c0e

Please sign in to comment.