forked from trunk-io/analytics-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
132 lines (107 loc) · 3.74 KB
/
pull_request.yml
File metadata and controls
132 lines (107 loc) · 3.74 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: Pull Request
run-name: Pull Request for ${{ github.ref_name }} by ${{ github.actor }}
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions: write-all
on:
pull_request: {}
workflow_dispatch: {}
push:
branches:
- main
env:
CARGO_TERM_COLOR: always
jobs:
build_release:
name: Build CLI for ${{ matrix.platform.target }}
strategy:
matrix:
platform:
- os-name: linux-x86_64
# cross-rs is unsupported on public-amd64-2xlarge
runs-on: ubuntu-latest
target: x86_64-unknown-linux-musl
- os-name: linux-aarch64
# cross-rs is unsupported on public-amd64-2xlarge
runs-on: ubuntu-24.04-arm
target: aarch64-unknown-linux-musl
- os-name: x86_64-linux
# cross-rs is unsupported on public-amd64-2xlarge
runs-on: ubuntu-latest
target: x86_64-unknown-illumos
- os-name: x86_64-darwin
runs-on: macos-latest
target: x86_64-apple-darwin
- os-name: aarch64-darwin
runs-on: macos-latest
target: aarch64-apple-darwin
runs-on: ${{ matrix.platform.runs-on }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
lfs: "true"
- name: Setup Xcode 16
if: contains(matrix.platform.os-name, 'darwin')
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 16
- name: Setup Rust & Cargo
uses: ./.github/actions/setup_rust_cargo
- name: Run tests
uses: ./.github/actions/run_tests
continue-on-error: true
with:
target: ${{ matrix.platform.target }}
- name: Build darwin target
uses: ./.github/actions/build_cli_macos_target
if: contains(matrix.platform.os-name, 'darwin')
with:
target: ${{ matrix.platform.target }}
profile: release
force-sentry-dev: true
- name: Build unix target
uses: ./.github/actions/build_cli_linux_target
if: "!contains(matrix.platform.os-name, 'darwin')"
with:
target: ${{ matrix.platform.target }}
profile: release
force-sentry-dev: true
- name: Upload results to staging using built CLI
env:
TRUNK_PUBLIC_API_ADDRESS: https://api.trunk-staging.io
shell: bash
if: "!contains(matrix.platform.target, 'illumos')"
run: |
target/${{ matrix.platform.target }}/release/trunk-analytics-cli upload \
--junit-paths ${{ github.workspace }}/target/**/*junit.xml \
--org-url-slug trunk-staging-org \
--token ${{ secrets.TRUNK_STAGING_ORG_API_TOKEN }}
- name: Upload results to prod using built CLI
shell: bash
if: "!contains(matrix.platform.target, 'illumos')"
run: |
target/${{ matrix.platform.target }}/release/trunk-analytics-cli upload \
--junit-paths ${{ github.workspace }}/target/**/*junit.xml \
--org-url-slug trunk \
--token ${{ secrets.TRUNK_PROD_ORG_API_TOKEN }}
trunk_check_runner:
name: Trunk Check runner [linux]
runs-on: public-amd64-2xlarge
steps:
- uses: actions/checkout@v4
- name: Setup Rust & Cargo
uses: ./.github/actions/setup_rust_cargo
- name: Setup Ruby
uses: ./.github/actions/setup_ruby
- name: Build workspace
run: cargo build --all
- name: Setup and build pyo3
uses: ./.github/actions/setup_build_pyo3
- name: Setup and build wasm
uses: ./.github/actions/setup_build_wasm
- name: Trunk Check
uses: trunk-io/trunk-action@v1
with:
cache: false