Skip to content

Update dependencies, add repro-env #11

Update dependencies, add repro-env

Update dependencies, add repro-env #11

Workflow file for this run

name: Rust
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Set up cargo cache
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-release-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-release-
- name: Build
run: make
- name: Print sha256 of binary
run: sha256sum target/x86_64-unknown-linux-musl/release/rshijack
- name: Upload binary
uses: actions/upload-artifact@v3
with:
name: bin
path: target/x86_64-unknown-linux-musl/release/rshijack
cross:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
arch:
- name: x86_64-unknown-linux-gnu
- name: x86_64-unknown-linux-musl
- name: i686-unknown-linux-gnu
binutils: i686-linux-gnu
- name: armv7-unknown-linux-gnueabihf
binutils: arm-linux-gnueabihf
- name: aarch64-unknown-linux-gnu
binutils: aarch64-linux-gnu
- name: aarch64-unknown-linux-musl
binutils: aarch64-linux-gnu
- name: powerpc64le-unknown-linux-gnu
binutils: powerpc64le-linux-gnu
- name: mipsel-unknown-linux-gnu
binutils: mipsel-linux-gnu
- name: mips64el-unknown-linux-gnuabi64
binutils: mips64el-linux-gnuabi64
- name: s390x-unknown-linux-gnu
binutils: s390x-linux-gnu
steps:
- name: Install binutils
run: |
sudo apt-get update
sudo apt-get install -y binutils-${{ matrix.arch.binutils }}
if: matrix.arch.binutils
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.arch.name }}
override: true
- uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --target ${{ matrix.arch.name }} --release
- name: Stripping binary
run: /usr/${{ matrix.arch.binutils }}/bin/strip target/${{ matrix.arch.name }}/release/rshijack
if: ${{ contains(matrix.arch.name, 'linux') }}
- uses: actions/upload-artifact@v2
with:
name: rshijack-${{ matrix.arch.name }}
path: target/${{ matrix.arch.name }}/release/rshijack
unit-test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-22.04]
steps:
- uses: actions/checkout@v3
- name: Set up cargo cache
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-debug-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-debug-
- name: Run clippy
run: cargo clippy -- -D warnings
- name: Run tests
run: cargo test --verbose
fmt:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Run cargo fmt
run: cargo fmt --all -- --check