Skip to content

Use Mozilla minimum supported rust version in Github workflows #378

Use Mozilla minimum supported rust version in Github workflows

Use Mozilla minimum supported rust version in Github workflows #378

Workflow file for this run

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:
strategy:
matrix:
include:
# Linux dummy crypto
- OS: ubuntu-latest
TARGET: ${{ env.MOZILLA_MSRV }}-x86_64-unknown-linux-gnu

Check failure on line 19 in .github/workflows/ci.yml

View workflow run for this annotation

GitHub Actions / Build and test

Invalid workflow file

The workflow is not valid. .github/workflows/ci.yml (Line: 19, Col: 21): Unrecognized named-value: 'env'. Located at position 1 within expression: env.MOZILLA_MSRV .github/workflows/ci.yml (Line: 28, Col: 21): Unrecognized named-value: 'env'. Located at position 1 within expression: env.MOZILLA_MSRV
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: ${{ env.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: ${{ env.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: ${{ env.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: ${{ env.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: ${{ env.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: ${{ env.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: ${{ env.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 }}