Skip to content

Commit

Permalink
Adapt CI to new test organization
Browse files Browse the repository at this point in the history
  • Loading branch information
stormshield-gt committed Nov 19, 2024
1 parent 2777cb9 commit 65ef402
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 109 deletions.
139 changes: 31 additions & 108 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,125 +16,48 @@ env:
TOOLCHAIN_PROFILE: minimal

jobs:
lint-vaultrs:
name: Run cargo fmt and cargo clippy for vaultrs
fmt:
runs-on: ubuntu-latest
name: stable / fmt
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: ${{ env.TOOLCHAIN_PROFILE }}
toolchain: ${{ env.RUST_TOOLCHAIN }}
override: true
components: rustfmt, clippy
- name: Use cache
uses: Swatinem/rust-cache@v1
- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
lint-vaultrs-login:
name: Run cargo fmt and cargo clippy for vaultrs-login
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: ${{ env.TOOLCHAIN_PROFILE }}
toolchain: ${{ env.RUST_TOOLCHAIN }}
override: true
components: rustfmt, clippy
- name: Use cache
uses: Swatinem/rust-cache@v1
with:
working-directory: vaultrs-login/
- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all --package vaultr-login -- --check
- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --package vaultrs-login -- -D warnings
test-vaultrs:
name: Run cargo test for vaultrs
- uses: actions/checkout@v4
- name: Install stable
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: cargo fmt
run: cargo fmt --check
clippy:
runs-on: ubuntu-latest
name: stable / clippy
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: ${{ env.TOOLCHAIN_PROFILE }}
toolchain: ${{ env.RUST_TOOLCHAIN }}
override: true
- name: Use cache
uses: Swatinem/rust-cache@v1
- name: Run cargo test with -no-run (compile tests)
uses: actions-rs/cargo@v1
with:
command: test
args: --no-run
- name: Run cargo test --all-features
uses: actions-rs/cargo@v1
env:
RUST_TEST_THREADS: 1
with:
command: test
args: --all-features
- name: Run cargo test
uses: actions-rs/cargo@v1
env:
RUST_TEST_THREADS: 1
with:
command: test
test-vaultrs-login:
name: Run cargo test for vaultrs-login
- uses: actions/checkout@v4
- name: Install stable
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: cargo clippy
run: cargo clippy --all-targets --all-features --workspace -- -D warnings
test:
runs-on: ubuntu-latest
name: stable / test
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: ${{ env.TOOLCHAIN_PROFILE }}
toolchain: ${{ env.RUST_TOOLCHAIN }}
override: true
- name: Use cache
uses: Swatinem/rust-cache@v1
with:
working-directory: vaultrs-login/
- name: Run cargo test with -no-run (compile tests)
uses: actions-rs/cargo@v1
with:
command: test
args: --package vaultrs-login --all-features --no-run
- name: Run cargo test
uses: actions-rs/cargo@v1
env:
RUST_TEST_THREADS: 1
with:
command: test
args: --package vaultrs-login --all-features
- uses: actions/checkout@v4
- name: Install stable
uses: dtolnay/rust-toolchain@stable
- name: cargo test
run: cargo test --all-targets --all-features --workspace
# https://github.com/rust-lang/cargo/issues/6669
- name: cargo test --doc
run: cargo test --all-features --workspace --doc

publish:
name: Publish to crates.io
runs-on: ubuntu-latest
if: startsWith(github.event.ref, 'refs/tags/v')
needs: [lint-vaultrs, lint-vaultrs-login, test-vaultrs, test-vaultrs-login]
needs: [fmt, clippy, test]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
profile: ${{ env.TOOLCHAIN_PROFILE }}
Expand Down
2 changes: 1 addition & 1 deletion typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
hashi = "hashi"

[files]
extend-exclude = ["tests/files/*"]
extend-exclude = ["vaultrs-tests/tests/files/*"]

0 comments on commit 65ef402

Please sign in to comment.