name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
schedule:
- cron: '0 0 * * *'
env:
CARGO_TERM_COLOR: always
jobs:
main:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
rust: ["1.71", stable, beta, nightly]
features: ["", "--features=std"]
runs-on: ${{ matrix.os }}
steps:
- run: "sudo apt-get update && sudo apt-get install language-pack-ja language-pack-uk -y"
if: "${{ matrix.os == 'ubuntu-latest' }}"
- run: "sudo sh -c 'echo ja_JP EUC-JP >> /etc/locale.gen'"
if: "${{ matrix.os == 'ubuntu-latest' }}"
- run: "sudo sh -c 'echo uk_UA KOI8-U >> /etc/locale.gen'"
if: "${{ matrix.os == 'ubuntu-latest' }}"
- run: "sudo locale-gen"
if: "${{ matrix.os == 'ubuntu-latest' }}"
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true
- run: "rustup component add clippy"
- uses: actions/checkout@v2
- run: "cargo build --verbose --no-default-features ${{ matrix.features }}"
- run: "cargo test --verbose --tests --no-default-features ${{ matrix.features }} -- --test-threads=1"
- run: "cargo test --verbose --doc --no-default-features ${{ matrix.features }}"
- run: "cargo doc --verbose --no-default-features ${{ matrix.features }}"
- run: "cargo build --verbose --release --no-default-features ${{ matrix.features }}"
- run: "cargo outdated --verbose --root-deps-only --exit-code 1 ${{ matrix.features }}"
- run: "cargo clippy --verbose --no-default-features ${{ matrix.features }}"
custom_errno:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
rust: ["1.71", stable, beta, nightly]
features: ["", "--features=std"]
env:
RUSTFLAGS: "--cfg=custom_errno"
RUSTDOCFLAGS: "--cfg=custom_errno"
runs-on: ${{ matrix.os }}
steps:
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true
- run: "rustup component add clippy"
- uses: actions/checkout@v2
- run: "cargo build --verbose --no-default-features ${{ matrix.features }}"
- run: "cargo test --verbose --tests --no-default-features ${{ matrix.features }} -- --test-threads=1"
- run: "cargo test --verbose --doc --no-default-features ${{ matrix.features }}"
- run: "cargo doc --verbose --no-default-features ${{ matrix.features }}"
- run: "cargo build --verbose --release --no-default-features ${{ matrix.features }}"
- run: "cargo outdated --verbose --root-deps-only --exit-code 1 ${{ matrix.features }}"
- run: "cargo clippy --verbose --no-default-features ${{ matrix.features }}"
ensure_no_std:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
triple: x86_64-unknown-linux-gnu
- os: windows-latest
triple: x86_64-pc-windows-msvc
runs-on: ${{ matrix.os }}
steps:
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
- run: "rustup component add rust-src --toolchain nightly-${{ matrix.triple }}"
- uses: actions/checkout@v2
- run: "cargo +nightly build --verbose -Z build-std=core,panic_abort --target ${{ matrix.triple }} --release"
working-directory: ensure_no_std
- run: "./ensure_no_std/target/${{ matrix.triple }}/release/ensure_no_std"
crosscompilation:
strategy:
fail-fast: false
matrix:
rust: ["1.71", stable, beta, nightly]
os: [ubuntu-latest, macOS-latest]
target: [x86_64-unknown-linux-gnu, i686-unknown-linux-gnu, x86_64-pc-windows-gnu, i686-pc-windows-gnu]
exclude:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: macOS-latest
target: x86_64-apple-darwin
- os: macOS-latest
target: i686-unknown-linux-gnu
runs-on: ${{ matrix.os }}
steps:
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true
- run: "rustup target add ${{ matrix.target }}"
- run: "sudo apt-get install -y gcc-multilib"
if: "${{ matrix.os == 'ubuntu-latest' }}"
- run: "brew tap SergioBenitez/osxct"
if: "${{ matrix.os == 'macOS-latest' }}"
- run: "brew install x86_64-unknown-linux-gnu"
if: "${{ matrix.os == 'macOS-latest' }}"
- uses: actions/checkout@v2
- run: "cargo build --verbose --target=${{ matrix.target }}"
env:
CC_x86_64_unknown_linux_gnu: x86_64-unknown-linux-gnu-gcc
- run: "cargo build --verbose --target=${{ matrix.target }} --release"
env:
CC_x86_64_unknown_linux_gnu: x86_64-unknown-linux-gnu-gcc