summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Anshul Gupta <ansg191@anshulg.com> 2024-11-30 12:55:28 -0800
committerGravatar Anshul Gupta <ansg191@anshulg.com> 2024-11-30 13:00:18 -0800
commit8810402f171c3ec28b5cb8a9c064406754ad682a (patch)
tree80e78a2e91b5c961497799b573ce854f58822b4f
parent61521f9e2901c356b14dd07ee40ec8ebca93717c (diff)
downloadkanidm-auth-plugin-8810402f171c3ec28b5cb8a9c064406754ad682a.tar.gz
kanidm-auth-plugin-8810402f171c3ec28b5cb8a9c064406754ad682a.tar.zst
kanidm-auth-plugin-8810402f171c3ec28b5cb8a9c064406754ad682a.zip
Add CI
-rw-r--r--.github/workflows/release-plz.yml27
-rw-r--r--.github/workflows/release.yml69
-rw-r--r--.github/workflows/rust.yml60
3 files changed, 156 insertions, 0 deletions
diff --git a/.github/workflows/release-plz.yml b/.github/workflows/release-plz.yml
new file mode 100644
index 0000000..0cdf5a8
--- /dev/null
+++ b/.github/workflows/release-plz.yml
@@ -0,0 +1,27 @@
+name: Release-plz
+
+permissions:
+ pull-requests: write
+ contents: write
+
+on:
+ push:
+ branches:
+ - main
+
+jobs:
+ release-plz:
+ name: Release-plz
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+ - name: Install Rust toolchain
+ uses: dtolnay/rust-toolchain@stable
+ - name: Run release-plz
+ uses: MarcoIeni/release-plz-action@v0.5
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+# CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 0000000..3722d05
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,69 @@
+name: CD
+
+permissions:
+ contents: write
+
+on:
+ release:
+ types: [published]
+
+env:
+ CARGO_INCREMENTAL: 0
+ CARGO_NET_GIT_FETCH_WITH_CLI: true
+ CARGO_NET_RETRY: 10
+ CARGO_TERM_COLOR: always
+ RUST_BACKTRACE: 1
+ RUSTFLAGS: -D warnings
+ RUSTUP_MAX_RETRIES: 10
+
+defaults:
+ run:
+ shell: bash
+
+jobs:
+ upload-assets:
+ name: ${{ matrix.target }}
+ if: github.repository_owner == 'ansg191'
+ runs-on: ${{ matrix.os }}
+ strategy:
+ matrix:
+ include:
+ - target: aarch64-unknown-linux-gnu
+ os: ubuntu-22.04
+ - target: aarch64-unknown-linux-musl
+ os: ubuntu-22.04
+ - target: aarch64-apple-darwin
+ os: macos-13
+# - target: aarch64-pc-windows-msvc
+# os: windows-2022
+ - target: x86_64-unknown-linux-gnu
+ os: ubuntu-22.04
+ - target: x86_64-unknown-linux-musl
+ os: ubuntu-22.04
+ - target: x86_64-apple-darwin
+ os: macos-13
+# - target: x86_64-pc-windows-msvc
+# os: windows-2022
+ - target: x86_64-unknown-freebsd
+ os: ubuntu-22.04
+ timeout-minutes: 60
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v4
+ - name: Install Rust toolchain
+ uses: dtolnay/rust-toolchain@stable
+ - uses: taiki-e/setup-cross-toolchain-action@v1
+ with:
+ target: ${{ matrix.target }}
+ if: startsWith(matrix.os, 'ubuntu') && !contains(matrix.target, '-musl')
+ - uses: taiki-e/install-action@cross
+ if: contains(matrix.target, '-musl')
+ - run: echo "RUSTFLAGS=${RUSTFLAGS} -C target-feature=+crt-static" >> "${GITHUB_ENV}"
+ if: endsWith(matrix.target, 'windows-msvc')
+ - uses: taiki-e/upload-rust-binary-action@v1
+ with:
+ bin: kanidm-auth-plugin
+ target: ${{ matrix.target }}
+ tar: all
+ zip: windows
+ token: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml
new file mode 100644
index 0000000..d6e36c7
--- /dev/null
+++ b/.github/workflows/rust.yml
@@ -0,0 +1,60 @@
+name: Rust
+
+on:
+ push:
+ branches: [ "main" ]
+ pull_request:
+ branches: [ "main" ]
+
+env:
+ CARGO_TERM_COLOR: always
+ RUSTFLAGS: '-D warnings'
+
+jobs:
+ build:
+ name: Test
+ strategy:
+ fail-fast: false
+ matrix:
+ os:
+ - ubuntu-latest
+ - macos-latest
+ runs-on: ${{ matrix.os }}
+
+ steps:
+ - uses: actions/checkout@v4
+ - uses: Swatinem/rust-cache@v2
+ - uses: dtolnay/rust-toolchain@stable
+ - name: Run Build
+ run: cargo build
+
+ fmt:
+ name: Format
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - uses: dtolnay/rust-toolchain@nightly
+ with:
+ components: rustfmt
+ - name: Run Rustfmt
+ run: cargo fmt -- --check
+
+ clippy:
+ name: Clippy
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - uses: Swatinem/rust-cache@v2
+ - uses: dtolnay/rust-toolchain@stable
+ with:
+ components: clippy
+ - name: Run Clippy
+ run: cargo clippy
+
+ cargo-deny:
+ name: Cargo-Deny
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v4
+ - uses: EmbarkStudios/cargo-deny-action@v2