-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (76 loc) · 2.52 KB
/
Copy pathci.yml
File metadata and controls
83 lines (76 loc) · 2.52 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
name: CI
on:
pull_request:
push:
branches: [main]
permissions:
contents: read
jobs:
rust:
name: Rust (${{ matrix.os }})
strategy:
matrix:
os: [blacksmith-4vcpu-ubuntu-2404, blacksmith-6vcpu-macos-15]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- run: cargo fmt --check
- run: cargo clippy --all-targets -- -D warnings
- run: cargo test --locked
installer:
strategy:
matrix:
os: [blacksmith-4vcpu-ubuntu-2404, blacksmith-6vcpu-macos-15]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v7
- if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y shellcheck
- if: runner.os == 'macOS'
run: brew install shellcheck
- run: shellcheck install.sh scripts/*.sh
- run: sh -n install.sh scripts/*.sh
- uses: dtolnay/rust-toolchain@stable
- run: sh scripts/test-installer.sh
homebrew:
strategy:
matrix:
# Blacksmith macOS is ARM64-only; retain native Intel coverage.
os: [blacksmith-6vcpu-macos-15, macos-15-intel]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v7
- run: brew tap codotcodes/co "$GITHUB_WORKSPACE"
- run: brew install codotcodes/co/co
- run: brew test codotcodes/co/co
- run: brew reinstall codotcodes/co/co
- run: co version
- run: brew uninstall codotcodes/co/co
packages:
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- uses: actions/checkout@v7
- run: sudo apt-get update && sudo apt-get install -y musl-tools
- uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-unknown-linux-musl
- uses: actions/setup-go@v6
with:
go-version: stable
- run: go install github.com/goreleaser/nfpm/v2/cmd/nfpm@v2.47.0
- run: cargo build --locked --release --target x86_64-unknown-linux-musl
- run: |
version="$(sed -n 's/^version = "\([^"]*\)"/\1/p' Cargo.toml | head -1)"
sh scripts/package-linux.sh "$version" x86_64-unknown-linux-musl target/x86_64-unknown-linux-musl/release/co dist
sh scripts/test-packages.sh dist "$version"
nix:
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- uses: actions/checkout@v7
- uses: DeterminateSystems/nix-installer-action@v22
- run: nix flake check
- run: nix build
- run: ./result/bin/co version