-
Notifications
You must be signed in to change notification settings - Fork 50
44 lines (44 loc) · 1.3 KB
/
cross.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: cross
on:
pull_request: {}
push:
branches:
- main
env:
CARGO_TERM_COLOR: always
jobs:
build:
strategy:
fail-fast: false
matrix:
target:
- x86_64-unknown-linux-gnu
- aarch64-unknown-linux-gnu
- powerpc64le-unknown-linux-gnu
- s390x-unknown-linux-gnu
- x86_64-pc-windows-gnu
- x86_64-unknown-freebsd
- x86_64-pc-solaris
name: ${{matrix.target}}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- name: Generate lockfile
run: cargo generate-lockfile
- name: Setup Cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cross-${{matrix.target}}-${{ hashFiles('**/Cargo.lock') }}
- name: Install cross-rs
run: |
cargo install cross --git https://github.com/cross-rs/cross
cross --version
- name: Ensure the latest base image
run: docker pull ghcr.io/cross-rs/${{matrix.target}}:main
- name: Build for ${{matrix.target}}
run: cross build -v --target ${{matrix.target}}