remove print env #3
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: Rust | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
env: | |
CARGO_TERM_COLOR: always | |
SQLX_OFFLINE: "true" | |
jobs: | |
unit-tests-darwin: | |
runs-on: macos-latest | |
strategy: | |
matrix: | |
arch: [x86_64, aarch64] | |
steps: | |
- name: Ensure musl installed | |
run: rustup target add ${{ matrix.arch }}-apple-darwin | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | |
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2 | |
- name: Run unit tests | |
run: cargo test --target ${{ matrix.arch }}-apple-darwin | |
unit-tests-linux: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
arch: [x86_64, aarch64] | |
steps: | |
- name: Ensure toolchain installed | |
run: sudo apt-get install -y musl-dev musl-tools musl gcc-aarch64-linux-gnu llvm clang qemu-user && rustup target add ${{ matrix.arch }}-unknown-linux-musl | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | |
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2 | |
- name: Set up environment variables | |
run: | | |
if [ "${{ matrix.arch }}" == "aarch64" ]; then | |
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_RUSTFLAGS=-Clink-self-contained=yes -Clinker=rust-lld" >> $GITHUB_ENV | |
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_RUNNER=qemu-aarch64 -L /usr/aarch64-linux-gnu" >> $GITHUB_ENV | |
echo "TARGET_CC=aarch64-linux-gnu-gcc" >> $GITHUB_ENV | |
echo "TARGET_AR=aarch64-linux-gnu-ar" >> $GITHUB_ENV | |
fi | |
- name: Run unit tests | |
run: cargo test --target ${{ matrix.arch }}-unknown-linux-musl | |
build-release-darwin: | |
runs-on: macos-latest | |
strategy: | |
matrix: | |
arch: [x86_64, aarch64] | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- name: Ensure toolchain installed | |
run: rustup target add ${{ matrix.arch }}-apple-darwin | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | |
- name: Build final release binary | |
run: cargo build --release --target ${{ matrix.arch }}-apple-darwin --verbose | |
- name: Upload artifact | |
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4 | |
with: | |
name: iam-assumer-darwin-${{ matrix.arch }} | |
path: target/${{ matrix.arch }}-apple-darwin/release/iam-assumer | |
build-release-linux: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
arch: [x86_64, aarch64] | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- name: Ensure musl installed | |
run: sudo apt-get install -y musl-dev musl-tools musl gcc-aarch64-linux-gnu llvm clang qemu-user && rustup target add ${{ matrix.arch }}-unknown-linux-musl | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | |
- name: Set up environment variables | |
run: | | |
if [ "${{ matrix.arch }}" == "aarch64" ]; then | |
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_RUSTFLAGS=-Clink-self-contained=yes -Clinker=rust-lld" >> $GITHUB_ENV | |
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_RUNNER=qemu-aarch64 -L /usr/aarch64-linux-gnu" >> $GITHUB_ENV | |
echo "TARGET_CC=aarch64-linux-gnu-gcc" >> $GITHUB_ENV | |
echo "TARGET_AR=aarch64-linux-gnu-ar" >> $GITHUB_ENV | |
fi | |
- name: Build final release binary | |
run: cargo build --release --target ${{ matrix.arch }}-unknown-linux-musl --verbose | |
- name: Upload artifact | |
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4 | |
with: | |
name: iam-assumer-linux-${{ matrix.arch }} | |
path: target/${{ matrix.arch }}-unknown-linux-musl/release/iam-assumer | |