generated from iotaledger/template
-
Notifications
You must be signed in to change notification settings - Fork 3
59 lines (48 loc) · 1.47 KB
/
build-and-test.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
name: Build and run tests
on:
push:
branches:
- main
pull_request:
types: [ opened, synchronize, reopened, ready_for_review ]
branches:
- main
- 'epic/**'
- 'support/**'
paths:
- '.github/workflows/build-and-test.yml'
- '.github/actions/**'
- '**.rs'
- '**.toml'
env:
RUST_BACKTRACE: full
jobs:
check-for-run-condition:
runs-on: ubuntu-latest
outputs:
should-run: ${{ !github.event.pull_request || github.event.pull_request.draft == false }}
steps:
- run: |
# this run step does nothing, but is needed to get the job output
build-and-test:
runs-on: ${{ matrix.os }}
needs: [ check-for-run-condition ]
if: ${{ needs.check-for-run-condition.outputs.should-run == 'true' }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest ]
steps:
- uses: actions/checkout@v3
- run: echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append
if: runner.os == 'Windows'
- run: vcpkg install openssl:x64-windows-static-md
if: runner.os == 'Windows'
- name: Setup Rust
uses: './.github/actions/rust/rust-setup'
- name: Build
run: cargo build --workspace --tests --examples --all-features --release
- name: Run tests
run: cargo test --workspace --all-features --release
- name: Run Rust example
run: cargo run --example sd_jwt