name: Continuous integration
on:
push:
branches:
- "**"
tags-ignore:
- "omegasort-*"
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref_type != 'tag' && github.ref != 'refs/heads/master' }}
permissions:
contents: read
env:
CRATE_NAME: omegasort
RUST_BACKTRACE: 1
jobs:
test:
name: Test - ${{ matrix.platform.os-name }} with rust ${{ matrix.toolchain }}
runs-on: ${{ matrix.platform.runs-on }}
permissions:
contents: read strategy:
fail-fast: false
matrix:
platform:
- os-name: FreeBSD-x86_64
runs-on: ubuntu-24.04
target: x86_64-unknown-freebsd
skip-tests: true
- os-name: Linux-x86_64
runs-on: ubuntu-24.04
target: x86_64-unknown-linux-musl
- os-name: Linux-aarch64
runs-on: ubuntu-24.04
target: aarch64-unknown-linux-musl
- os-name: Linux-arm
runs-on: ubuntu-24.04
target: arm-unknown-linux-musleabi
- os-name: Linux-i686
runs-on: ubuntu-24.04
target: i686-unknown-linux-musl
- os-name: Linux-powerpc
runs-on: ubuntu-24.04
target: powerpc-unknown-linux-gnu
- os-name: Linux-powerpc64
runs-on: ubuntu-24.04
target: powerpc64-unknown-linux-gnu
- os-name: Linux-powerpc64le
runs-on: ubuntu-24.04
target: powerpc64le-unknown-linux-gnu
- os-name: Linux-riscv64
runs-on: ubuntu-24.04
target: riscv64gc-unknown-linux-gnu
- os-name: Linux-s390x
runs-on: ubuntu-24.04
target: s390x-unknown-linux-gnu
- os-name: NetBSD-x86_64
runs-on: ubuntu-24.04
target: x86_64-unknown-netbsd
skip-tests: true
- os-name: Windows-aarch64
runs-on: windows-latest
target: aarch64-pc-windows-msvc
skip-tests: true
- os-name: Windows-i686
runs-on: windows-latest
target: i686-pc-windows-msvc
- os-name: Windows-x86_64
runs-on: windows-latest
target: x86_64-pc-windows-msvc
- os-name: macOS-x86_64
runs-on: macOS-latest
target: x86_64-apple-darwin
- os-name: macOS-aarch64
runs-on: macOS-latest
target: aarch64-apple-darwin
toolchain:
- stable
include:
- platform:
os-name: Linux-x86_64
runs-on: ubuntu-24.04
target: x86_64-unknown-linux-musl
toolchain: beta
- platform:
os-name: Linux-x86_64
runs-on: ubuntu-24.04
target: x86_64-unknown-linux-musl
toolchain: nightly
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 with:
persist-credentials: false
- name: Run tests
uses: houseabsolute/actions-rust-cross@21b0f18dc621b25bfae556ff2791fca4173121e8 with:
command: "test"
target: ${{ matrix.platform.target }}
toolchain: ${{ matrix.toolchain }}
args: "--locked --release"
if: ${{ !matrix.platform.skip-tests }}
- name: Build binary
uses: houseabsolute/actions-rust-cross@21b0f18dc621b25bfae556ff2791fca4173121e8 with:
command: "build"
target: ${{ matrix.platform.target }}
toolchain: ${{ matrix.toolchain }}
args: "--locked --release"
- name: Package artifacts
uses: houseabsolute/actions-rust-release@9e126fd5fc18f4cecf358b3909f3991ad59663dc with:
executable-name: omegasort
target: ${{ matrix.platform.target }}
if: matrix.toolchain == 'stable'
publish-release:
name: Publish GitHub release
runs-on: ubuntu-24.04
needs: test
if: github.ref_type == 'tag' && startsWith(github.ref_name, 'v')
permissions:
actions: read contents: write steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 with:
persist-credentials: false
- name: Publish
uses: houseabsolute/actions-rust-release/publish@9e126fd5fc18f4cecf358b3909f3991ad59663dc with:
executable-name: omegasort
publish-crates:
name: Publish to crates.io
runs-on: ubuntu-24.04
needs: test
if: github.ref_type == 'tag' && startsWith(github.ref_name, 'v')
permissions:
contents: read id-token: write steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 with:
persist-credentials: false
- name: Install Rust
run: |
rustup toolchain install stable --profile minimal --no-self-update
rustup default stable
- name: Get a crates.io token
uses: rust-lang/crates-io-auth-action@c6f97d42243bad5fab37ca0427f495c86d5b1a18 id: auth
- name: Publish
run: cargo publish --locked
env:
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}