-
Notifications
You must be signed in to change notification settings - Fork 19
133 lines (133 loc) · 5.34 KB
/
native_build.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
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
name: Native
on: [push, pull_request]
env:
CARGO_TERM_COLOR: always
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
jobs:
SyncBuildAndTestS:
strategy:
matrix:
# XXX(RLB): It would be good to just use macos-latest here, but
# apparently if you do that, sometimes you get an older (not latest)
# version. And we require v14 in order to build the CryptoKit provider.
os: [ubuntu-latest, macos-14, windows-latest]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: arduino/setup-protoc@v2
with:
version: "25.x"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
- uses: ilammy/setup-nasm@v1
if: runner.os == 'Windows'
- run: |
echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append
vcpkg install openssl:x64-windows-static-md sqlite3:x64-windows-static-md
echo "OPENSSL_DIR=C:/vcpkg/packages/openssl_x64-windows-static-md" | Out-File -FilePath $env:GITHUB_ENV -Append
curl -o C:/cacert.pem https://curl.se/ca/cacert.pem
echo "SSL_CERT_FILE=C:/cacert.pem" | Out-File -FilePath $env:GITHUB_ENV -Append
if: runner.os == 'Windows'
- name: Test Full RFC Compliance
run: cargo test --all-features --verbose --workspace
- name: Test Bare Bones
run: cargo test --no-default-features --features std,test_util --verbose --workspace
- name: Examples
working-directory: mls-rs
run: cargo run --example basic_usage
AsyncBuildAndTest:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
fail-fast: false
runs-on: ${{ matrix.os }}
env:
RUSTFLAGS: '--cfg mls_build_async'
steps:
- uses: actions/checkout@v3
- uses: arduino/setup-protoc@v2
with:
version: "25.x"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
- uses: ilammy/setup-nasm@v1
if: runner.os == 'Windows'
- run: |
echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append
vcpkg install openssl:x64-windows-static-md sqlite3:x64-windows-static-md
echo "OPENSSL_DIR=C:/vcpkg/packages/openssl_x64-windows-static-md" | Out-File -FilePath $env:GITHUB_ENV -Append
curl -o C:/cacert.pem https://curl.se/ca/cacert.pem
echo "SSL_CERT_FILE=C:/cacert.pem" | Out-File -FilePath $env:GITHUB_ENV -Append
if: runner.os == 'Windows'
- name: Test Async Full RFC
run: cargo test --lib --test '*' --verbose --features test_util -p mls-rs
- name: Test Async Bare Bones
run: cargo test --no-default-features --lib --test '*' --features std,test_util --verbose -p mls-rs
LintAndFormatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: arduino/setup-protoc@v2
with:
version: "25.x"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Rust Fmt
run: cargo fmt --all -- --check
- name: Clippy Full RFC Compliance
run: cargo clippy --all-targets --all-features --workspace -- -D warnings
- name: Clippy Bare Bones
run: cargo clippy --all-targets --no-default-features --features std,test_util --workspace -- -D warnings
LintAndFormattingMacOS:
# XXX(RLB): It would be good to just use macos-latest here, but
# apparently if you do that, sometimes you get an older (not latest)
# version. And we require v14 in order to build the CryptoKit provider.
runs-on: macos-14
steps:
- uses: actions/checkout@v3
- uses: arduino/setup-protoc@v2
with:
version: "25.x"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Rust Fmt
run: cargo fmt -p mls-rs-crypto-cryptokit -- --check
- name: Clippy
run: cargo clippy -p mls-rs-crypto-cryptokit -- -D warnings
CodeCoverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly
- uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Setup code coverage
run: cargo install cargo-llvm-cov
- name: Run code coverage
# Using `cargo llvm-cov show-env` lets us capture coverage
# information from Python integration tests.
run: |
source <(cargo llvm-cov show-env --export-prefix)
cargo llvm-cov clean --workspace
cargo test --features "test_util"
cargo llvm-cov report --lcov --output-path lcov.info
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
files: lcov.info
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}