Merge pull request #97 from stormshield-gt/add_cert_auth_configuration #289
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: | |
- master | |
paths-ignore: | |
- '**.md' | |
pull_request: | |
paths-ignore: | |
- '**.md' | |
workflow_dispatch: | |
name: CI | |
env: | |
RUST_TOOLCHAIN: stable | |
TOOLCHAIN_PROFILE: minimal | |
jobs: | |
lint-vaultrs: | |
name: Run cargo fmt and cargo clippy for vaultrs | |
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 | |
- 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 | |
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 | |
- 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 | |
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 | |
- 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 | |
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] | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: ${{ env.TOOLCHAIN_PROFILE }} | |
toolchain: ${{ env.RUST_TOOLCHAIN }} | |
override: true | |
- uses: katyo/publish-crates@v1 | |
with: | |
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }} |