Use Mozilla minimum supported rust version in Github workflows #377
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and test | ||
on: [push, pull_request] | ||
# Make sure CI fails on all warnings, including Clippy lints | ||
env: | ||
RUSTFLAGS: "-Dwarnings" | ||
# Minimum supported rust version for mozilla-central | ||
# https://firefox-source-docs.mozilla.org/writing-rust-code/update-policy.html | ||
MOZILLA_MSRV: "1.66" | ||
jobs: | ||
build: | ||
env: | ||
Check failure on line 14 in .github/workflows/ci.yml GitHub Actions / Build and testInvalid workflow file
|
||
strategy: | ||
matrix: | ||
include: | ||
# Linux dummy crypto | ||
- OS: ubuntu-latest | ||
TARGET: ${{ MOZILLA_MSRV }}-x86_64-unknown-linux-gnu | ||
NATIVE_BUILD: true | ||
ADD_INSTALL: | | ||
sudo apt-get update | ||
sudo apt-get install -y libudev-dev | ||
BUILD_OPTIONS: --features crypto_dummy --no-default-features | ||
# Linux NSS crypto | ||
- OS: ubuntu-latest | ||
TARGET: ${{ MOZILLA_MSRV }}-x86_64-unknown-linux-gnu | ||
NATIVE_BUILD: true | ||
ADD_INSTALL: | | ||
sudo apt-get update | ||
sudo apt-get install -y libudev-dev mercurial node-gyp ninja-build | ||
BUILD_OPTIONS: --features crypto_nss --no-default-features | ||
# Linux openSSL crypto | ||
- OS: ubuntu-latest | ||
TARGET: ${{ MOZILLA_MSRV }}-x86_64-unknown-linux-gnu | ||
NATIVE_BUILD: true | ||
ADD_INSTALL: | | ||
sudo apt-get update | ||
sudo apt-get install -y libudev-dev openssl | ||
BUILD_OPTIONS: --features crypto_openssl --no-default-features | ||
# Mac dummy crypto | ||
- OS: macos-latest | ||
TARGET: ${{ MOZILLA_MSRV }}-x86_64-apple-darwin | ||
NATIVE_BUILD: true | ||
BUILD_OPTIONS: --features crypto_dummy --no-default-features --target=x86_64-apple-darwin | ||
# Windows dummy crypto | ||
- OS: windows-latest | ||
TARGET: ${{ MOZILLA_MSRV }}-x86_64-pc-windows-gnu | ||
NATIVE_BUILD: true | ||
BUILD_OPTIONS: --features crypto_dummy --no-default-features --target=x86_64-pc-windows-gnu | ||
# FreeBSD - cross compile | ||
- OS: ubuntu-latest | ||
TARGET: ${{ MOZILLA_MSRV }}-x86_64-unknown-freebsd | ||
NATIVE_BUILD: false | ||
ADD_INSTALL: | | ||
sudo apt-get update | ||
sudo apt-get install -y libudev-dev | ||
BUILD_OPTIONS: --features crypto_dummy --no-default-features | ||
# netBSD - cross compile | ||
- OS: ubuntu-latest | ||
TARGET: ${{ MOZILLA_MSRV }}-x86_64-unknown-netbsd | ||
NATIVE_BUILD: false | ||
ADD_INSTALL: | | ||
sudo apt-get update | ||
sudo apt-get install -y libudev-dev | ||
BUILD_OPTIONS: --features crypto_dummy --no-default-features | ||
# Android - cross compile | ||
- OS: ubuntu-latest | ||
TARGET: ${{ MOZILLA_MSRV }}-x86_64-linux-android | ||
NATIVE_BUILD: false | ||
ADD_INSTALL: | | ||
sudo apt-get update | ||
sudo apt-get install -y libudev-dev | ||
BUILD_OPTIONS: --features crypto_dummy --no-default-features | ||
runs-on: ${{ matrix.OS }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Install latest rust toolchain | ||
run: rustup target add ${{ matrix.TARGET }} | ||
- name: Install Packages | ||
if: ${{ matrix.ADD_INSTALL }} | ||
run: ${{ matrix.ADD_INSTALL }} | ||
- name: Build | ||
run: cargo build --target ${{ matrix.TARGET }} --all --release ${{ matrix.BUILD_OPTIONS }} | ||
- name: Test | ||
# Run tests only if it is a native build | ||
if: ${{ matrix.NATIVE_BUILD }} | ||
run: cargo test --target ${{ matrix.TARGET }} ${{ matrix.BUILD_OPTIONS }} -- --show-output | ||
- name: Clippy | ||
run: cargo clippy --all --target ${{ matrix.TARGET }} ${{ matrix.BUILD_OPTIONS }} |