Skip to content

Commit

Permalink
ci: add cross ci check
Browse files Browse the repository at this point in the history
Signed-off-by: simonsan <[email protected]>
  • Loading branch information
simonsan committed Sep 18, 2023
1 parent 015f963 commit 178d358
Show file tree
Hide file tree
Showing 2 changed files with 103 additions and 16 deletions.
16 changes: 0 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,6 @@ on:
types: [checks_requested]

jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1
with:
profile: minimal
toolchain: stable
override: true
- uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2
- uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 # v1
with:
command: check
args: --all-features --workspace

fmt:
name: Rustfmt
runs-on: ubuntu-latest
Expand Down
103 changes: 103 additions & 0 deletions .github/workflows/cross-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: Cross CI

on:
pull_request:
paths-ignore:
- "**/*.md"
push:
branches:
- main
- "renovate/**"
- "release/**"
paths-ignore:
- "**/*.md"
merge_group:
types: [checks_requested]

defaults:
run:
shell: bash

jobs:
publish:
name: Cross checking ${{ matrix.job.target }}
runs-on: ${{ matrix.job.os }}
strategy:
fail-fast: false
matrix:
rust: [stable]
job:
- os: windows-latest
os-name: windows
target: x86_64-pc-windows-msvc
architecture: x86_64
use-cross: false
- os: macos-latest
os-name: macos
target: x86_64-apple-darwin
architecture: x86_64
use-cross: false
- os: macos-latest
os-name: macos
target: aarch64-apple-darwin
architecture: arm64
use-cross: true
- os: ubuntu-latest
os-name: linux
target: x86_64-unknown-linux-gnu
architecture: x86_64
use-cross: false
- os: ubuntu-latest
os-name: linux
target: x86_64-unknown-linux-musl
architecture: x86_64
binary-postfix: ""
use-cross: false
- os: ubuntu-latest
os-name: linux
target: aarch64-unknown-linux-gnu
architecture: arm64
use-cross: true
- os: ubuntu-latest
os-name: linux
target: i686-unknown-linux-gnu
architecture: i686
use-cross: true
- os: ubuntu-latest
os-name: netbsd
target: x86_64-unknown-netbsd
architecture: x86_64
use-cross: true
- os: ubuntu-latest
os-name: linux
target: armv7-unknown-linux-gnueabihf
architecture: armv7
use-cross: true

steps:
- name: Checkout repository
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
with:
fetch-depth: 0 # fetch all history so that git describe works
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true
target: ${{ matrix.job.target }}
- name: install compiler
shell: bash
if: ${{ matrix.job.target == 'x86_64-unknown-linux-musl' }}
run: |
sudo apt update
sudo apt-get install -y musl-tools
- uses: Swatinem/rust-cache@e207df5d269b42b69c8bc5101da26f7d31feddb4 # v2
with:
key: ${{ matrix.job.target }}
- name: Cargo check
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 # v1
with:
command: check
use-cross: ${{ matrix.job.use-cross }}
toolchain: ${{ matrix.job.toolchain }}
args: --release --all-features --target ${{ matrix.job.target }}

0 comments on commit 178d358

Please sign in to comment.