chore: add integration tests encrypted environment (#132) #287
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
name: ci | |
on: | |
pull_request: | |
push: | |
branches: [ main ] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
env: | |
CARGO_TERM_COLOR: always | |
RUST_BACKTRACE: full | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
timeout-minutes: 20 | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: stable | |
components: rustfmt, clippy | |
- name: Cache rust build files | |
uses: Leafwing-Studios/cargo-cache@c7e8aa40ae2c975774d3bd766beb92927cfd7771 # v1 | |
- name: rustfmt | |
run: cargo fmt --all -- --check | |
- name: check (release) | |
run: cargo check --workspace --all-targets --all-features --release | |
- name: clippy | |
run: cargo clippy --workspace --all-targets --all-features -- -D warnings --force-warn deprecated --force-warn dead-code | |
## Tests | |
# Install sops (needed for decrypting tests .env file) | |
- name: Setup sops | |
uses: nhedger/setup-sops@v2 | |
# Install age (needed for decrypting tests .env file) | |
- name: Setup age | |
uses: alessiodionisi/[email protected] | |
- name: unit-tests | |
uses: LNSD/sops-exec-action@v1 | |
env: | |
SOPS_AGE_KEY: ${{ secrets.IT_TESTS_AGE_KEY }} | |
with: | |
env_file: .env | |
run: cargo test --workspace --all-features --lib | |
- name: integration-tests | |
uses: LNSD/sops-exec-action@v1 | |
env: | |
SOPS_AGE_KEY: ${{ secrets.IT_TESTS_AGE_KEY }} | |
with: | |
env_file: .env | |
run: cargo test --workspace --all-features --test '*' |