Repository navigation
103 lines (103 loc) · 3.56 KB
/
Copy pathci.yml
File metadata and controls
103 lines (103 loc) · 3.56 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: CI
on:
pull_request:
branches: [main, dev]
push:
branches: [main, dev]
merge_group:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ci-${{ github.event_name }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
jobs:
quality:
name: Quality
runs-on: ubuntu-24.04
timeout-minutes: 25
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable
with:
toolchain: 1.99.1
components: clippy, rustfmt
- name: Cache Rust artifacts
uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
with:
cache-bin: false
- name: Check formatting
run: cargo fmt --all --check
- name: Run strict Clippy
run: cargo clippy --locked --workspace --all-targets --all-features -- -D warnings -D clippy::all -D clippy::pedantic -D clippy::nursery -D clippy::cargo
- name: Build API documentation
run: cargo doc --locked --workspace --all-features --no-deps
env:
RUSTDOCFLAGS: -D warnings
build:
name: Build (${{ matrix.asset_suffix }})
runs-on: ${{ matrix.runner }}
timeout-minutes: 35
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-apple-darwin
runner: macos-15-intel
binary_suffix: ""
asset_suffix: macos-intel
- target: aarch64-apple-darwin
runner: macos-15
binary_suffix: ""
asset_suffix: macos-apple-silicon
- target: x86_64-unknown-linux-gnu
runner: ubuntu-24.04
binary_suffix: ""
asset_suffix: linux-x86_64
- target: aarch64-unknown-linux-gnu
runner: ubuntu-24.04-arm
binary_suffix: ""
asset_suffix: linux-arm64
- target: x86_64-pc-windows-msvc
runner: windows-latest
binary_suffix: ".exe"
asset_suffix: windows-x86_64
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable
with:
toolchain: 1.99.1
targets: ${{ matrix.target }}
- name: Cache Rust artifacts
uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
with:
key: ${{ matrix.target }}
cache-bin: false
- name: Build CLI
run: cargo build --locked --workspace --all-features --target ${{ matrix.target }} --bin rustpost-cli
- name: Run native terminal and CLI regressions
run: cargo test --locked --workspace --all-features --target ${{ matrix.target }}
- name: Verify native executable and architecture
shell: bash
env:
TARGET: ${{ matrix.target }}
SUFFIX: ${{ matrix.binary_suffix }}
run: |
set -euo pipefail
binary="target/${TARGET}/debug/rustpost-cli${SUFFIX}"
"$binary" --version
if [[ "$TARGET" == *apple-darwin ]]; then
if [[ "$TARGET" == x86_64-* ]]; then arch=x86_64; else arch=arm64; fi
lipo "$binary" -verify_arch "$arch"
fi