From 6a9bf72b72db3f29d9756844c16d4e950e0d99fc Mon Sep 17 00:00:00 2001 From: "Paul R. Tagliamonte" Date: Sat, 5 Oct 2024 17:28:02 -0400 Subject: [PATCH] add in github workflow --- .github/dependabot.yml | 25 +++++++++++++++++++++ .github/workflows/cargo-build.yml | 28 ++++++++++++++++++++++++ .github/workflows/cargo-clippy.yml | 33 ++++++++++++++++++++++++++++ .github/workflows/cargo-fmt.yml | 35 ++++++++++++++++++++++++++++++ .github/workflows/cargo-test.yml | 35 ++++++++++++++++++++++++++++++ 5 files changed, 156 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/cargo-build.yml create mode 100644 .github/workflows/cargo-clippy.yml create mode 100644 .github/workflows/cargo-fmt.yml create mode 100644 .github/workflows/cargo-test.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..b7b633e --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,25 @@ +# 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://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "cargo" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "daily" + reviewers: + - 'paultag' + - package-ecosystem: "github-actions" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "daily" + reviewers: + - 'paultag' + - package-ecosystem: "gitsubmodule" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "daily" + reviewers: + - 'paultag' diff --git a/.github/workflows/cargo-build.yml b/.github/workflows/cargo-build.yml new file mode 100644 index 0000000..5398407 --- /dev/null +++ b/.github/workflows/cargo-build.yml @@ -0,0 +1,28 @@ +on: + push: + branches: + - main + paths: + - "**.rs" + - Cargo.toml + - Cargo.lock + - .github/workflows/cargo-build.yml + pull_request: + paths: + - "**.rs" + - Cargo.toml + - Cargo.lock + - .github/workflows/cargo-build.yml +permissions: read-all +name: cargo build +jobs: + cargobuild: + name: cargo build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions-rust-lang/setup-rust-toolchain@v1 + - name: Run cargo build + run: | + cargo build --all-features + shell: bash diff --git a/.github/workflows/cargo-clippy.yml b/.github/workflows/cargo-clippy.yml new file mode 100644 index 0000000..d277940 --- /dev/null +++ b/.github/workflows/cargo-clippy.yml @@ -0,0 +1,33 @@ +on: + push: + branches: + - main + paths: + - "**.rs" + - Cargo.toml + - Cargo.lock + - .github/workflows/cargo-clippy.yml + - "rust-toolchain.toml" + - "openapi/*.json" + pull_request: + paths: + - "**.rs" + - Cargo.toml + - Cargo.lock + - .github/workflows/cargo-clippy.yml + - "rust-toolchain.toml" + - "openapi/*.json" +name: cargo clippy +jobs: + cargoclippy: + name: cargo clippy + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + components: clippy + - name: Run clippy + run: cargo clippy --all-features --tests -- -D warnings + - name: Cargo check --release + run: cargo check --release diff --git a/.github/workflows/cargo-fmt.yml b/.github/workflows/cargo-fmt.yml new file mode 100644 index 0000000..8c1599e --- /dev/null +++ b/.github/workflows/cargo-fmt.yml @@ -0,0 +1,35 @@ +on: + push: + branches: + - main + paths: + - "**.rs" + - "engine" + - "rust-toolchain" + - "rust-toolchain.toml" + - .github/workflows/cargo-fmt.yml + pull_request: + paths: + - "**.rs" + - "rust-toolchain" + - "rust-toolchain.toml" + - .github/workflows/cargo-fmt.yml + - "engine" +permissions: + packages: read + contents: read +name: cargo fmt +jobs: + cargofmt: + name: cargo fmt + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + components: rustfmt + rustflags: "" # use our .cargo/config.toml + - name: Run cargo fmt + run: | + cargo fmt -- --check + shell: bash diff --git a/.github/workflows/cargo-test.yml b/.github/workflows/cargo-test.yml new file mode 100644 index 0000000..baa7c3a --- /dev/null +++ b/.github/workflows/cargo-test.yml @@ -0,0 +1,35 @@ +on: + push: + branches: + - main + paths: + - "**.rs" + - Cargo.toml + - Cargo.lock + - .github/workflows/cargo-test.yml + pull_request: + paths: + - "**.rs" + - Cargo.toml + - Cargo.lock + - .github/workflows/cargo-test.yml + workflow_dispatch: +permissions: read-all +name: cargo test +jobs: + cargotest: + name: cargo test + runs-on: ubuntu-latest + strategy: + matrix: + flags: [ + "--all-features", + "--no-default-features --features ''" + ] + steps: + - uses: actions/checkout@v4 + - uses: actions-rust-lang/setup-rust-toolchain@v1 + - name: cargo test + shell: bash + run: | + cargo test ${{ matrix.flags }}