Skip to content

Commit d70e8a7

Browse files
committed
Add loci-analysis workflow from overlay
1 parent f04a37c commit d70e8a7

File tree

1 file changed

+75
-0
lines changed

1 file changed

+75
-0
lines changed
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: LOCI Analysis
2+
on:
3+
push:
4+
branches:
5+
- loci/main-*
6+
pull_request:
7+
types: [opened, synchronize, reopened]
8+
9+
jobs:
10+
loci:
11+
if: vars.UPSTREAM_REPO != ''
12+
runs-on: ubuntu-latest
13+
14+
env:
15+
LOCI_PROJECT: 'nextest'
16+
LOCI_API_KEY: '${{ secrets.LOCI_API_KEY }}'
17+
LOCI_BACKEND_URL: '${{ vars.LOCI_BACKEND_URL }}'
18+
GH_TOKEN: ${{ secrets.MIRROR_REPOS_WRITE_PAT }}
19+
CC_aarch64_unknown_linux_gnu: "aarch64-linux-gnu-gcc"
20+
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: "aarch64-linux-gnu-gcc"
21+
RUSTFLAGS: "-C debuginfo=2"
22+
23+
environment: ${{ vars.LOCI_ENV || 'PROD__AL_DEMO' }}
24+
25+
steps:
26+
- name: Checkout repository
27+
uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 0
30+
ref: ${{ (github.event_name == 'pull_request' && github.event.pull_request.head.sha) || github.sha }}
31+
32+
- name: Compute target
33+
id: target
34+
if: github.event_name == 'push'
35+
run: |
36+
branch="${{ github.ref_name }}"
37+
sha="${branch#loci/main-}"
38+
echo "value=main@${sha}" >> "$GITHUB_OUTPUT"
39+
40+
- name: Compute base
41+
id: base
42+
if: github.event_name == 'pull_request'
43+
run: |
44+
git remote add upstream "https://github.com/${{ vars.UPSTREAM_REPO }}.git" 2>/dev/null || true
45+
git fetch upstream
46+
upstream_default=$(gh api "repos/${{ vars.UPSTREAM_REPO }}" --jq .default_branch)
47+
merge_base=$(git merge-base HEAD "upstream/${upstream_default}")
48+
short_sha="${merge_base:0:7}"
49+
echo "value=main@${short_sha}" >> "$GITHUB_OUTPUT"
50+
51+
- name: Install dependencies
52+
run: sudo apt install gcc-aarch64-linux-gnu && rustup target add aarch64-unknown-linux-gnu
53+
shell: bash -euo pipefail {0}
54+
55+
- name: Build
56+
run: cargo build --target aarch64-unknown-linux-gnu --release
57+
shell: bash -euo pipefail {0}
58+
59+
- name: Upload
60+
uses: auroralabs-loci/loci-action@v1
61+
with:
62+
mode: upload
63+
binaries: |
64+
target/aarch64-unknown-linux-gnu/release/build-seed-archive
65+
target/aarch64-unknown-linux-gnu/release/cargo-nextest
66+
target/aarch64-unknown-linux-gnu/release/fake-interceptor
67+
target/aarch64-unknown-linux-gnu/release/grab-foreground
68+
target/aarch64-unknown-linux-gnu/release/internal-test
69+
target/aarch64-unknown-linux-gnu/release/large-alloc
70+
target/aarch64-unknown-linux-gnu/release/passthrough
71+
target/aarch64-unknown-linux-gnu/release/rustc-shim
72+
target/aarch64-unknown-linux-gnu/release/zstd-dict
73+
project: '${{ env.LOCI_PROJECT }}'
74+
target: ${{ steps.target.outputs.value || ''}}
75+
base: ${{ steps.base.outputs.value || '' }}

0 commit comments

Comments
 (0)