-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (79 loc) · 2.46 KB
/
rust.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: Rust
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: 'read'
id-token: 'write'
steps:
- name: Install Protoc
uses: arduino/setup-protoc@v1
- uses: actions/checkout@v3
- name: Build
run: cargo build --verbose
# - id: 'auth'
# name: 'Authenticate to Google Cloud'
# uses: 'google-github-actions/auth@v0'
# with:
## credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}'
# workload_identity_provider: 'projects/38828066182/locations/global/workloadIdentityPools/gh-pool/providers/gh-provider'
# service_account: '[email protected]'
# create_credentials_file: true
# id_token_include_email: true
# export_environment_variables: true
# cleanup_credentials: true
# - name: 'Set up Cloud SDK'
# uses: google-github-actions/setup-gcloud@v0
# with:
# project_id: ${{ env.PROJECT_ID }}
# export_default_credentials: true
# - name: 'Use gcloud CLI'
# run: 'gcloud info'
- name: Create key
env:
GOOGLE_APPLICATION_CREDENTIALS: '${{ secrets.GOOGLE_CREDENTIALS }}'
run: echo $GOOGLE_APPLICATION_CREDENTIALS > gcp.json
- name: Run tests
env:
GOOGLE_CLOUD_PROJECT: 'ssn-public-dev'
GOOGLE_APPLICATION_CREDENTIALS: 'gcp.json'
# GOOGLE_APPLICATION_CREDENTIALS: ${{ steps.auth.outputs.credentials_file_path }}
run: cargo test --verbose
- name: Cleanup
run: rm -f gcp.json
clippy_check:
runs-on: ubuntu-latest
steps:
- name: Install Protoc
uses: arduino/setup-protoc@v1
- uses: actions/checkout@v1
- run: rustup component add clippy
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: -- -D warnings
cargo-deny:
runs-on: ubuntu-latest
steps:
- name: Install Protoc
uses: arduino/setup-protoc@v1
- uses: actions/checkout@v2
- uses: EmbarkStudios/cargo-deny-action@v1
docs:
name: Docs
runs-on: ubuntu-latest
steps:
- name: Install Protoc
uses: arduino/setup-protoc@v1
- uses: actions/checkout@v2
- name: Install Rust
run: rustup update stable
- name: cargo doc
run: cargo doc --no-deps