|
| 1 | +name: CI VM |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: ["main"] |
| 5 | + paths-ignore: ["*.md", "*.png", "*.svg", "LICENSE-*"] |
| 6 | + pull_request: |
| 7 | + branches: ["main"] |
| 8 | + paths-ignore: ["*.md", "*.png", "*.svg", "LICENSE-*"] |
| 9 | + merge_group: |
| 10 | + workflow_dispatch: |
| 11 | +env: |
| 12 | + CARGO_TERM_COLOR: always |
| 13 | + RUST_BACKTRACE: 1 |
| 14 | + RUST_LOG: trace |
| 15 | + |
| 16 | +concurrency: |
| 17 | + group: ${{ github.workflow }}-${{ github.ref_name }} |
| 18 | + cancel-in-progress: true |
| 19 | + |
| 20 | +permissions: |
| 21 | + contents: read |
| 22 | + |
| 23 | +jobs: |
| 24 | + check-vm: |
| 25 | + strategy: |
| 26 | + fail-fast: false |
| 27 | + matrix: |
| 28 | + os: [freebsd, openbsd, netbsd, solaris] |
| 29 | + runs-on: ubuntu-latest |
| 30 | + |
| 31 | + steps: |
| 32 | + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 33 | + |
| 34 | + - id: nss-version |
| 35 | + run: echo "minimum=$(cat neqo-crypto/min_version.txt)" >> "$GITHUB_OUTPUT" |
| 36 | + |
| 37 | + - run: curl -o rustup.sh --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs |
| 38 | + |
| 39 | + - if: matrix.os == 'freebsd' |
| 40 | + uses: vmactions/freebsd-vm@debf37ca7b7fa40e19c542ef7ba30d6054a706a4 |
| 41 | + with: |
| 42 | + usesh: true |
| 43 | + envs: "CARGO_TERM_COLOR RUST_BACKTRACE RUST_LOG GITHUB_ACTIONS" |
| 44 | + prepare: | # This executes as root |
| 45 | + set -e |
| 46 | + pkg install -y curl llvm nss pkgconf |
| 47 | + run: | # This executes as user |
| 48 | + set -e |
| 49 | + # FIXME: We're only comparing the NSS minor version here. |
| 50 | + NSS_MINOR_VERSION="$(pkg-config --modversion nss | cut -d. -f2)" |
| 51 | + NSS_MINIMUM_VERSION="$(echo ${{ steps.nss-version.outputs.minimum }} | cut -d. -f2)" |
| 52 | + if [ "$NSS_MINOR_VERSION" -lt "$NSS_MINIMUM_VERSION" ]; then |
| 53 | + echo "System NSS package too old (minorversion $NSS_MINOR_VERSION < $NSS_MINIMUM_VERSION); skipping checks" |
| 54 | + exit 0 |
| 55 | + fi |
| 56 | + sh rustup.sh --default-toolchain stable --profile minimal --component clippy llvm-tools -y |
| 57 | + . "$HOME/.cargo/env" |
| 58 | + cargo check --all-targets |
| 59 | + cargo clippy -- -D warnings |
| 60 | + cargo install cargo-llvm-cov --locked |
| 61 | + cargo llvm-cov test --no-fail-fast --lcov --output-path lcov.info |
| 62 | + cargo test --no-fail-fast --release |
| 63 | + rm -rf target # Don't sync this back to host |
| 64 | +
|
| 65 | + - if: matrix.os == 'openbsd' |
| 66 | + uses: vmactions/openbsd-vm@0cfe06e734a0ea3a546fca7ebf200b984b94d58a |
| 67 | + with: |
| 68 | + usesh: true |
| 69 | + envs: "CARGO_TERM_COLOR RUST_BACKTRACE RUST_LOG GITHUB_ACTIONS" |
| 70 | + prepare: | # This executes as root |
| 71 | + set -e |
| 72 | + pkg_add rust rust-clippy llvm-16.0.6p30 nss pkgconf # rustup doesn't support OpenBSD at all |
| 73 | + run: | # This executes as user |
| 74 | + set -e |
| 75 | + # FIXME: We're only comparing the NSS minor version here. |
| 76 | + NSS_MINOR_VERSION="$(pkg-config --modversion nss | cut -d. -f2)" |
| 77 | + NSS_MINIMUM_VERSION="$(echo ${{ steps.nss-version.outputs.minimum }} | cut -d. -f2)" |
| 78 | + if [ "$NSS_MINOR_VERSION" -lt "$NSS_MINIMUM_VERSION" ]; then |
| 79 | + echo "System NSS package too old (minorversion $NSS_MINOR_VERSION < $NSS_MINIMUM_VERSION); skipping checks" |
| 80 | + exit 0 |
| 81 | + fi |
| 82 | + export LIBCLANG_PATH=/usr/local/llvm16/lib |
| 83 | + cargo check --all-targets |
| 84 | + cargo clippy -- -D warnings |
| 85 | + # FIXME: No profiler support in openbsd currently, error is: |
| 86 | + # > error[E0463]: can't find crate for `profiler_builtins` |
| 87 | + # > = note: the compiler may have been built without the profiler runtime |
| 88 | + # export LLVM_COV=/usr/local/llvm16/bin/llvm-cov |
| 89 | + # export LLVM_PROFDATA=/usr/local/llvm16/bin/llvm-profdata |
| 90 | + # cargo install cargo-llvm-cov --locked |
| 91 | + # cargo llvm-cov test --no-fail-fast --lcov --output-path lcov.info |
| 92 | + cargo test --no-fail-fast # Remove this once profiler is supported |
| 93 | + cargo test --no-fail-fast --release |
| 94 | + rm -rf target # Don't sync this back to host |
| 95 | +
|
| 96 | + - if: matrix.os == 'netbsd' |
| 97 | + uses: vmactions/netbsd-vm@7c9086fdb4cc1aa814cda6e305390c2b966551a9 |
| 98 | + with: |
| 99 | + usesh: true |
| 100 | + envs: "CARGO_TERM_COLOR RUST_BACKTRACE RUST_LOG GITHUB_ACTIONS" |
| 101 | + prepare: | # This executes as root |
| 102 | + set -e |
| 103 | + /usr/sbin/pkg_add pkgin |
| 104 | + pkgin -y install curl clang nss pkgconf |
| 105 | + run: | # This executes as user |
| 106 | + set -e |
| 107 | + # FIXME: We're only comparing the NSS minor version here. |
| 108 | + NSS_MINOR_VERSION="$(pkg-config --modversion nss | cut -d. -f2)" |
| 109 | + NSS_MINIMUM_VERSION="$(echo ${{ steps.nss-version.outputs.minimum }} | cut -d. -f2)" |
| 110 | + if [ "$NSS_MINOR_VERSION" -lt "$NSS_MINIMUM_VERSION" ]; then |
| 111 | + echo "System NSS package too old (minorversion $NSS_MINOR_VERSION < $NSS_MINIMUM_VERSION); skipping checks" |
| 112 | + exit 0 |
| 113 | + fi |
| 114 | + sh rustup.sh --default-toolchain stable --profile minimal --component clippy llvm-tools -y |
| 115 | + . "$HOME/.cargo/env" |
| 116 | + # FIXME: Why do we need to set this on NetBSD? |
| 117 | + export LD_LIBRARY_PATH=/usr/pkg/lib/nss:/usr/pkg/lib/nspr |
| 118 | + cargo check --all-targets |
| 119 | + cargo clippy -- -D warnings |
| 120 | + # FIXME: No profiler support in netbsd currently, error is: |
| 121 | + # > error[E0463]: can't find crate for `profiler_builtins` |
| 122 | + # > = note: the compiler may have been built without the profiler runtime |
| 123 | + # cargo install cargo-llvm-cov --locked |
| 124 | + # cargo llvm-cov test --no-fail-fast --lcov --output-path lcov.info |
| 125 | + cargo test --no-fail-fast # Remove this once profiler is supported |
| 126 | + cargo test --no-fail-fast --release |
| 127 | + rm -rf target # Don't sync this back to host |
| 128 | +
|
| 129 | + - if: matrix.os == 'solaris' |
| 130 | + uses: vmactions/solaris-vm@a89b9438868c70db27e41625f0a5de6ff5e90809 |
| 131 | + with: |
| 132 | + release: "11.4-gcc" |
| 133 | + usesh: true |
| 134 | + envs: "CARGO_TERM_COLOR RUST_BACKTRACE RUST_LOG GITHUB_ACTIONS" |
| 135 | + prepare: | # This executes as root |
| 136 | + set -e |
| 137 | + pkg install clang-libs nss pkg-config |
| 138 | + run: | # This executes as also as root on Solaris |
| 139 | + set -e |
| 140 | + # FIXME: We're only comparing the NSS minor version here. |
| 141 | + NSS_MINOR_VERSION="$(pkg-config --modversion nss | cut -d. -f2)" |
| 142 | + NSS_MINIMUM_VERSION="$(echo ${{ steps.nss-version.outputs.minimum }} | cut -d. -f2)" |
| 143 | + if [ "$NSS_MINOR_VERSION" -lt "$NSS_MINIMUM_VERSION" ]; then |
| 144 | + echo "System NSS package too old (minorversion $NSS_MINOR_VERSION < $NSS_MINIMUM_VERSION); skipping checks" |
| 145 | + exit 0 |
| 146 | + fi |
| 147 | + source <(curl -s https://raw.githubusercontent.com/psumbera/solaris-rust/refs/heads/main/sh.rust-web-install) || true # This doesn't exit with zero on success |
| 148 | + export LIBCLANG_PATH="/usr/lib/amd64" |
| 149 | + cargo check --all-targets |
| 150 | + cargo clippy -- -D warnings |
| 151 | + # FIXME: No profiler support in openbsd currently, error is: |
| 152 | + # > error[E0463]: can't find crate for `profiler_builtins` |
| 153 | + # > = note: the compiler may have been built without the profiler runtime |
| 154 | + # cargo install cargo-llvm-cov --locked |
| 155 | + # cargo llvm-cov test --no-fail-fast --lcov --output-path lcov.info |
| 156 | + cargo test --no-fail-fast # Remove this once profiler is supported |
| 157 | + cargo test --no-fail-fast --release |
| 158 | + rm -rf target # Don't sync this back to host |
| 159 | +
|
| 160 | + - uses: codecov/codecov-action@015f24e6818733317a2da2edd6290ab26238649a # v5.0.7 |
| 161 | + with: |
| 162 | + files: lcov.info |
| 163 | + fail_ci_if_error: false |
| 164 | + token: ${{ secrets.CODECOV_TOKEN }} |
| 165 | + verbose: true |
| 166 | + env: |
| 167 | + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |
0 commit comments