| 1 |
# |
| 2 |
# Copyright 2023 The Sigstore Authors. |
| 3 |
# |
| 4 |
# Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 |
# you may not use this file except in compliance with the License. |
| 6 |
# You may obtain a copy of the License at |
| 7 |
# |
| 8 |
# http://www.apache.org/licenses/LICENSE-2.0 |
| 9 |
# |
| 10 |
# Unless required by applicable law or agreed to in writing, software |
| 11 |
# distributed under the License is distributed on an "AS IS" BASIS, |
| 12 |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 |
# See the License for the specific language governing permissions and |
| 14 |
# limitations under the License. |
| 15 |
|
| 16 |
name: Check Rust build |
| 17 |
|
| 18 |
permissions: |
| 19 |
contents: read |
| 20 |
|
| 21 |
on: |
| 22 |
push: |
| 23 |
branches: [main] |
| 24 |
pull_request: {} |
| 25 |
|
| 26 |
env: |
| 27 |
CARGO_TERM_COLOR: always |
| 28 |
|
| 29 |
jobs: |
| 30 |
build: |
| 31 |
name: Build Rust generated code |
| 32 |
runs-on: ubuntu-latest |
| 33 |
strategy: |
| 34 |
matrix: |
| 35 |
toolchain: |
| 36 |
- stable |
| 37 |
- beta |
| 38 |
- nightly |
| 39 |
|
| 40 |
steps: |
| 41 |
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 42 |
with: |
| 43 |
persist-credentials: false |
| 44 |
- run: rustup update ${TOOLCHAIN} && rustup default ${TOOLCHAIN} |
| 45 |
env: |
| 46 |
TOOLCHAIN: ${{ matrix.toolchain }} |
| 47 |
- run: | |
| 48 |
make rust |
| 49 |
- run: | |
| 50 |
RUST_ACTION="build -p sigstore_protobuf_specs" make rust |
| 51 |
|
| 52 |
test: |
| 53 |
name: Test Rust generated code |
| 54 |
runs-on: ubuntu-latest |
| 55 |
strategy: |
| 56 |
matrix: |
| 57 |
toolchain: |
| 58 |
- stable |
| 59 |
|
| 60 |
steps: |
| 61 |
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 62 |
with: |
| 63 |
persist-credentials: false |
| 64 |
- run: rustup update ${TOOLCHAIN} && rustup default ${TOOLCHAIN} |
| 65 |
env: |
| 66 |
TOOLCHAIN: ${{ matrix.toolchain }} |
| 67 |
- run: | |
| 68 |
make rust RUST_ACTION=test |