-
Notifications
You must be signed in to change notification settings - Fork 3
142 lines (138 loc) · 4.88 KB
/
ci.yaml
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
name: CI
on:
push:
branches:
- master
pull_request:
schedule:
- cron: "0 14 * * 1" # Mondays at 2pm UTC
jobs:
cargo-test:
env:
IRONCORE_ENV: dev
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# different operating systems
os: [ubuntu-18.04, ubuntu-20.04, macos-10.15, windows-2019]
features: [default]
toolchain: [stable]
include:
# different features combinations
- os: ubuntu-18.04
features: beta
- os: ubuntu-18.04
features: blocking
- os: ubuntu-18.04
features: "blocking beta"
# different tls implementations
- os: ubuntu-18.04
features: tls-rustls --no-default-features
- os: ubuntu-18.04
features: tls-vendored-openssl --no-default-features
# MSRV
- os: ubuntu-18.04
toolchain: 1.41.1
features: default
steps:
- uses: actions/checkout@v2
- if: matrix.toolchain != ''
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
# This was disabled because of intermittent failures after a cache hit in macos-10.15
#
# - name: Generate Cargo.lock so we can cache from it
# run: cargo generate-lockfile
# - uses: actions/cache@v2
# with:
# path: |
# ~/.cargo/registry
# ~/.cargo/git
# target
# key: ${{ github.workflow }}-rust-${{ matrix.os }}-${{ hashFiles('**/Cargo.lock') }}
# restore-keys: |
# ${{ github.workflow }}-rust-${{ matrix.os }}-
- name: Decrypt test keys
run: openssl aes-256-cbc -d -K ${{ secrets.OPENSSL_KEY }} -iv ${{ secrets.OPENSSL_IV }} -in tests/testkeys/iak-dev.pem.enc -out tests/testkeys/iak-dev.pem
# Generate the Cargo.lock that will be used for the tests so we can upload it as an artifact
- name: Generate lockfile
run: cargo generate-lockfile
- name: Upload Cargo.lock
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.os }}-${{ matrix.features }}-${{ matrix.toolchain }}-Cargo.lock
path: Cargo.lock
- name: Cargo test
run: cargo test --features ${{ matrix.features }}
- name: Post to Slack on failure in main
if: failure() && github.event_name == 'schedule'
run: |
curl -L -X POST '${{ secrets.SLACK_WEBHOOK }}' \
-F "payload={\"text\": \"Failed a run of <$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID|$GITHUB_REPOSITORY>.\"}"
cargo-build:
runs-on: ${{ matrix.os }}
continue-on-error: true
strategy:
matrix:
target:
- aarch64-linux-android
- armv7-linux-androideabi
- i686-linux-android
- x86_64-linux-android
- x86_64-unknown-linux-musl
os:
- ubuntu-18.04
include:
- target: aarch64-apple-ios
os: macos-10.15
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
# This was disabled because of intermittent failures after a cache hit in macos-10.15
#
# - name: Generate Cargo.lock so we can cache from it
# run: cargo generate-lockfile
# - uses: actions/cache@v2
# with:
# path: |
# ~/.cargo/registry
# ~/.cargo/git
# target
# key: ${{ github.workflow }}-rust-arch-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
# restore-keys: |
# ${{ github.workflow }}-rust-arch-${{ matrix.target }}-
- uses: actions-rs/cargo@v1
with:
# `cross` will work on all our targets except aarch64-apple-ios. We can still use `cross` everywhere, because it transparently falls back to `cargo`.
use-cross: true
command: build
args: --target ${{ matrix.target }} --features "beta blocking tls-rustls" --no-default-features
- name: Post to Slack on failure in main
if: failure() && github.event_name == 'schedule'
run: |
curl -L -X POST '${{ secrets.SLACK_WEBHOOK }}' \
-F "payload={\"text\": \"Failed a run of <$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID|$GITHUB_REPOSITORY>.\"}"
format:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt
- uses: actions-rs/install@v0.1
with:
crate: cargo-sort-ck
version: latest
- run: cargo fmt --all -- --check
- run: cargo-sort-ck
- name: Cancel workflow
if: failure()
uses: andymckay/cancel-action@0.2