Pull Request for 118/merge by dfrankland #491
Workflow file for this run
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: Pull Request | |
run-name: Pull Request for ${{ github.ref_name }} by ${{ github.actor }} | |
concurrency: | |
group: ${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
permissions: write-all | |
on: | |
pull_request: {} | |
workflow_dispatch: {} | |
push: | |
branches: | |
- trunk-merge/** | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build_release_osx: | |
strategy: | |
matrix: | |
target: [x86_64-apple-darwin, aarch64-apple-darwin] | |
name: Build CLI for ${{ matrix.target }} | |
runs-on: macos-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
lfs: "true" | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@nightly | |
with: | |
targets: ${{ matrix.target }} | |
- name: Install Trunk | |
uses: trunk-io/trunk-action/install@54ccfcf9add644a36a5aa1d0046c92f654ff9e45 | |
- name: Add target | |
shell: bash | |
run: rustup target add ${{ matrix.target }} | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.arch }}-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: Install latest nextest release | |
uses: taiki-e/install-action@nextest | |
- name: Run tests | |
run: cargo nextest run --workspace ${{ contains(matrix.target, 'musl') && '--exclude context-js --exclude context-py' || '' }} --profile=ci | |
- name: Build ${{ matrix.target }} target | |
if: "!cancelled()" | |
run: cargo build -q --workspace ${{ contains(matrix.target, 'musl') && '--exclude context-js --exclude context-py' || '' }} --release --target ${{ matrix.target }} | |
- name: Upload results using action from ${{ matrix.target }} | |
env: | |
TRUNK_PUBLIC_API_ADDRESS: https://api.trunk-staging.io | |
run: | | |
target/${{ matrix.target }}/release/trunk-analytics-cli upload \ | |
--junit-paths ${{ github.workspace }}/target/**/*junit.xml \ | |
--org-url-slug trunk-staging-org \ | |
--token ${{ secrets.TRUNK_STAGING_ORG_API_TOKEN }} | |
build_release_linux: | |
strategy: | |
matrix: | |
include: | |
- target: x86_64-unknown-linux-musl | |
runs-on: public-amd64-2xlarge | |
- target: aarch64-unknown-linux-musl | |
runs-on: public-arm64-2xlarge | |
name: Build CLI for ${{ matrix.target }} | |
runs-on: ${{ matrix.runs-on }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
lfs: "true" | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@nightly | |
- name: Install Trunk | |
uses: trunk-io/trunk-action/install@54ccfcf9add644a36a5aa1d0046c92f654ff9e45 | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.arch }}-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: Install nextest | |
if: matrix.target != 'aarch64-unknown-linux-musl' | |
run: curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin | |
- name: Install nextest for ARM | |
if: matrix.target == 'aarch64-unknown-linux-musl' | |
run: curl -LsSf https://get.nexte.st/latest/linux-arm | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin | |
- name: Run tests | |
run: cargo nextest run --workspace ${{ contains(matrix.target, 'musl') && '--exclude context-js --exclude context-py' || '' }} --profile=ci | |
- name: Build ${{ matrix.target }} target | |
uses: ./.github/actions/build_target | |
if: "!cancelled()" | |
with: | |
target: ${{ matrix.target }} | |
profile: release | |
- name: Upload results using action from ${{ matrix.target }} | |
env: | |
TRUNK_PUBLIC_API_ADDRESS: https://api.trunk-staging.io | |
run: | | |
target/${{ matrix.target }}/release/trunk-analytics-cli upload \ | |
--junit-paths ${{ github.workspace }}/target/**/*junit.xml \ | |
--org-url-slug trunk-staging-org \ | |
--token ${{ secrets.TRUNK_STAGING_ORG_API_TOKEN }} | |
trunk_check_runner: | |
name: Trunk Check runner [linux] | |
runs-on: public-amd64-small | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Trunk Check | |
uses: trunk-io/trunk-action@v1 | |
with: | |
cache: false |