Build & test #496
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 & test | |
permissions: | |
contents: write | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
strategy: | |
matrix: | |
build: [linux, macos, windows] | |
include: | |
- build: linux | |
os: ubuntu-latest | |
- build: macos | |
os: macos-latest | |
- build: windows | |
os: windows-latest | |
extension: .exe | |
runs-on: ${{matrix.os}} | |
steps: | |
- uses: actions/[email protected] | |
- uses: actions-rs/[email protected] | |
with: | |
toolchain: stable | |
- name: Build | |
env: | |
RUSTFLAGS: -D warnings | |
uses: actions-rs/[email protected] | |
with: | |
command: build | |
args: --release --all --exclude mla-fuzz-afl --verbose | |
- name: Run tests | |
run: cargo test --all --exclude mla-fuzz-afl --release --verbose | |
- name: Upload resulting 'mlar' | |
uses: actions/[email protected] | |
with: | |
name: ${{ matrix.build }} | |
path: ./target/release/mlar${{ matrix.extension }} | |
long-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
- uses: actions-rs/[email protected] | |
with: | |
toolchain: stable | |
- name: Run long tests | |
run: cd mla && cargo test --release -- --ignored | |
all-features: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
- uses: actions-rs/[email protected] | |
with: | |
toolchain: stable | |
- name: Run long tests | |
run: cargo test --all-features --all --exclude mla-fuzz-afl --exclude mla-bindings-c --release | |
test-bindings-c-cpp-linux: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
- uses: actions-rs/[email protected] | |
with: | |
toolchain: stable | |
- name: Run C bindings tests on Linux | |
working-directory: bindings/C/tests/linux-gcc-g++/ | |
run: make CC=gcc | |
- name: Run C bindings tests on Linux | |
working-directory: bindings/C/tests/linux-gcc-g++/ | |
run: make CC=g++ | |
test-bindings-c-cpp-windows: | |
strategy: | |
matrix: | |
version: [Debug-c, Release-c, Debug-cpp, Release-cpp] | |
target: [x86_64-pc-windows-msvc, i686-pc-windows-msvc] | |
include: | |
- version: Debug-c | |
cargo_arg: "" | |
- version: Release-c | |
cargo_arg: --release | |
- version: Debug-cpp | |
cargo_arg: "" | |
- version: Release-cpp | |
cargo_arg: --release | |
- target: i686-pc-windows-msvc | |
msvc_platform: Win32 | |
- target: x86_64-pc-windows-msvc | |
msvc_platform: x64 | |
runs-on: windows-latest | |
steps: | |
- uses: actions/[email protected] | |
- uses: actions-rs/[email protected] | |
with: | |
# pin to 1.82 cf. https://github.com/ANSSI-FR/MLA/pull/227#issuecomment-2545916785 | |
toolchain: 1.82 | |
default: true | |
target: ${{ matrix.target }} | |
- uses: microsoft/setup-msbuild@v2 | |
- name: Compile C/CPP bindings test program for Windows | |
working-directory: bindings/C/tests/windows-msvc/ | |
run: msbuild mla-bindings-test.sln /p:Platform=${{ matrix.msvc_platform }} /p:Configuration=${{ matrix.version }} | |
- name: Run C/CPP bindings test program on Windows | |
working-directory: bindings/C/tests/windows-msvc/ | |
run: ./${{ matrix.msvc_platform }}/${{ matrix.version }}/mla-bindings-test.exe | |
afl-build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
- uses: actions-rs/[email protected] | |
with: | |
toolchain: stable | |
- name: Install dependencies | |
run: sudo apt-get install llvm | |
- name: Install cargo-afl binary crate | |
uses: actions-rs/[email protected] | |
with: | |
crate: cargo-afl | |
version: latest | |
use-tool-cache: true | |
- name: Test AFL build | |
env: | |
RUSTFLAGS: -D warnings | |
run: cargo afl build | |
fmt: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
- uses: actions-rs/[email protected] | |
with: | |
toolchain: stable | |
components: rustfmt | |
- name: Check format | |
run: cargo fmt --all -- --check | |
audit: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
- name: Security audit | |
uses: actions-rs/[email protected] | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
clippy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
- uses: actions-rs/[email protected] | |
with: | |
toolchain: stable | |
components: clippy | |
- name: Install dependencies | |
run: sudo apt-get install llvm | |
- name: Install cargo-afl binary crate | |
uses: actions-rs/[email protected] | |
with: | |
crate: cargo-afl | |
version: latest | |
use-tool-cache: true | |
- uses: actions-rs/[email protected] | |
with: | |
command: clippy | |
args: --all-targets -- -D warnings | |
publish-dry-run: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
- uses: actions-rs/[email protected] | |
with: | |
toolchain: stable | |
- name: Dry-run publish curve25519-parser | |
run: cd curve25519-parser && cargo publish --dry-run | |
- name: Dry-run publish mla | |
run: cd mla && cargo publish --dry-run | |
- name: Dry-run publish mlar | |
run: cd mlar && cargo publish --dry-run | |