Skip to content

Commit 6d8f64f

Browse files
authored
feat(ci): add PR, release workflows (#199)
1 parent 63c9b0a commit 6d8f64f

3 files changed

Lines changed: 96 additions & 0 deletions

File tree

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Setup Tangram CI Directory
2+
description: Configure /opt/tangram as the Tangram build directory for CI
3+
4+
runs:
5+
using: composite
6+
steps:
7+
- name: Create /opt/tangram directory
8+
shell: bash
9+
run: mkdir -p /opt/tangram/bin
10+
11+
- name: Write config
12+
shell: bash
13+
run: |
14+
cat > /opt/tangram/config.json <<'CONFIG'
15+
{
16+
"directory": "/opt/tangram",
17+
"remotes": [{
18+
"name": "default",
19+
"url": "https://staging.tangram.dev"
20+
}]
21+
}
22+
CONFIG
23+
24+
- name: Create tangram wrapper
25+
shell: bash
26+
run: |
27+
cat > /opt/tangram/bin/tangram <<'WRAPPER'
28+
#!/bin/sh
29+
exec tangram --config /opt/tangram/config.json "$@"
30+
WRAPPER
31+
chmod +x /opt/tangram/bin/tangram
32+
33+
- name: Set TG_EXE
34+
shell: bash
35+
run: echo "TG_EXE=/opt/tangram/bin/tangram" >> "$GITHUB_ENV"

.github/workflows/pr.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: PR Validation
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened, ready_for_review]
6+
7+
jobs:
8+
test:
9+
name: Test (${{ matrix.platform }})
10+
runs-on: ${{ matrix.runner }}
11+
environment: test
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
include:
16+
- platform: aarch64-darwin
17+
runner: [self-hosted, macOS, ARM64]
18+
- platform: x86_64-linux
19+
runner: [self-hosted, Linux, X64]
20+
- platform: aarch64-linux
21+
runner: [self-hosted, Linux, ARM64]
22+
steps:
23+
- uses: actions/checkout@v4
24+
- uses: oven-sh/setup-bun@v2
25+
- uses: ./.github/actions/setup-tangram
26+
- run: bun install --frozen-lockfile
27+
- name: Verify formatting
28+
run: |
29+
bun run auto --format
30+
git diff --exit-code
31+
- name: Check
32+
run: bun run auto --check
33+
- name: Test
34+
run: bun run auto --test --retry

.github/workflows/release.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
jobs:
8+
release:
9+
name: Release (${{ matrix.platform }})
10+
runs-on: ${{ matrix.runner }}
11+
environment: release
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
include:
16+
- platform: aarch64-darwin
17+
runner: [self-hosted, macOS, ARM64]
18+
- platform: x86_64-linux
19+
runner: [self-hosted, Linux, X64]
20+
- platform: aarch64-linux
21+
runner: [self-hosted, Linux, ARM64]
22+
steps:
23+
- uses: actions/checkout@v4
24+
- uses: oven-sh/setup-bun@v2
25+
- uses: ./.github/actions/setup-tangram
26+
- run: bun install --frozen-lockfile
27+
- run: bun run auto --release

0 commit comments

Comments
 (0)