forked from mozilla/neqo
-
Notifications
You must be signed in to change notification settings - Fork 1
92 lines (83 loc) · 2.85 KB
/
check.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
name: CI
on: [push, pull_request]
env:
CARGO_TERM_COLOR: always
jobs:
check:
name: Neqo Build and Test
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
rust-toolchain: [stable, 1.65.0]
runs-on: ${{ matrix.os }}
steps:
- name: Install Dependencies (Linux)
if: runner.os == 'Linux'
env:
DEBIAN_FRONTEND: noninteractive
llvm_version: 14
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
clang \
git \
gyp \
libclang-dev \
libssl-dev \
lld \
llvm-"$llvm_version" \
llvm-"$llvm_version"-runtime \
make \
mercurial \
ninja-build \
pkg-config \
ssh \
zlib1g-dev \
--no-install-recommends
[ -d "/usr/lib/llvm-$llvm_version/lib" ]
echo "LIBCLANG_DIR=/usr/lib/llvm-$llvm_version/lib" >> "$GITHUB_ENV"
- name: Install Dependencies (Windows)
if: runner.os == 'Windows'
run: |
echo TBD
- name: Install Dependencies (MacOS)
if: runner.os == 'MacOS'
run: |
brew install mercurial git ninja
python3 -m pip install gyp-next
export PATH="$(python3 -m site --user-base)/bin:$PATH"
echo $PATH
- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ matrix.rust-toolchain }}
- name: Checkout
uses: actions/checkout@v4
# This step might be removed if the distro included a recent enough
# version of NSS. Ubuntu 20.04 only has 3.49, which is far too old.
# (neqo-crypto/build.rs would also need to query pkg-config to get the
# right build flags rather than building NSS.)
- name: Fetch NSS and NSPR
run: |
hg clone https://hg.mozilla.org/projects/nspr "$NSPR_DIR"
git clone --depth=1 https://github.com/nss-dev/nss "$NSS_DIR"
echo "NSS_DIR=$NSS_DIR" >> "$GITHUB_ENV"
echo "NSPR_DIR=$NSPR_DIR" >> "$GITHUB_ENV"
env:
NSS_DIR: ${{ github.workspace }}/nss
NSPR_DIR: ${{ github.workspace }}/nspr
- name: Build
run: cargo +${{ matrix.rust-toolchain }} build -v --tests
- name: Run Tests
run: cargo +${{ matrix.rust-toolchain }} test -v
env:
LD_LIBRARY_PATH: ${{ github.workspace }}/dist/Debug/lib
RUST_BACKTRACE: 1
RUST_LOG: neqo=debug
- name: Check formatting
run: cargo +${{ matrix.rust-toolchain }} fmt --all -- --check
if: ${{ success() || failure() }}
- name: Clippy
run: cargo +${{ matrix.rust-toolchain }} clippy -v --tests -- -D warnings
if: ${{ success() || failure() }}