-
Notifications
You must be signed in to change notification settings - Fork 19
44 lines (44 loc) · 1.64 KB
/
tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: tests & formatting
on:
push:
pull_request:
types: [ opened ]
workflow_dispatch:
env:
GCP_PROJECT: latestbit
GCP_PROJECT_ID: 288860578009
concurrency:
group: ${{ github.workflow }}-${{ github.ref_protected && github.run_id || github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: 'read'
id-token: 'write'
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: rustfmt, clippy
- name: Authenticate to Google Cloud development
id: auth
uses: google-github-actions/auth@v2
if: github.ref == 'refs/heads/master'
with:
workload_identity_provider: 'projects/${{ env.GCP_PROJECT_ID }}/locations/global/workloadIdentityPools/lb-github-identity-pool/providers/lb-github-identity-pool-provider'
service_account: 'lb-github-service-account@${{ env.GCP_PROJECT }}.iam.gserviceaccount.com'
create_credentials_file: true
access_token_lifetime: '240s'
- name: 'Set up Cloud SDK'
uses: google-github-actions/setup-gcloud@v2
if: github.ref == 'refs/heads/master'
- name: 'Checking formatting and clippy'
run: cargo fmt -- --check && cargo clippy -- -Dwarnings
- name: 'Run lib tests'
run: cargo test --lib --features "caching-memory,caching-persistent"
if: github.ref != 'refs/heads/master'
- name: 'Run all tests'
run: cargo test --features "caching-memory,caching-persistent"
if: github.ref == 'refs/heads/master'