Repository navigation
97 lines (80 loc) · 2.89 KB
/
Copy pathomp-runner.yml
File metadata and controls
97 lines (80 loc) · 2.89 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
name: omp runner binaries
on:
push:
branches:
- main
pull_request:
paths:
- "runner/**"
- ".github/workflows/omp-runner.yml"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
test:
name: Typecheck and test
runs-on: ubuntu-latest
defaults:
run:
working-directory: runner
steps:
- name: Checkout repository
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
- name: Setup Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: 1.4.4
- name: Fetch the pinned omp packages
run: bun scripts/use-omp-build.ts
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Typecheck
run: bunx tsc -p .
- name: Test
run: bun test
build:
name: Build (${{ matrix.target }})
# Bun cross-compiles every target from Linux, as omp's own release does.
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- { target: linux-x64, os: linux, cpu: x64, binary: ompweb-omp-linux-x64 }
- { target: linux-arm64, os: linux, cpu: arm64, binary: ompweb-omp-linux-arm64 }
- { target: darwin-x64, os: darwin, cpu: x64, binary: ompweb-omp-darwin-x64 }
- { target: darwin-arm64, os: darwin, cpu: arm64, binary: ompweb-omp-darwin-arm64 }
- { target: windows-x64, os: win32, cpu: x64, binary: ompweb-omp-windows-x64.exe }
defaults:
run:
working-directory: runner
steps:
- name: Checkout repository
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
- name: Setup Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: 1.4.4
- name: Fetch the pinned omp packages
run: bun scripts/use-omp-build.ts
# The host's own addon package is not needed; the target's is what gets embedded.
- name: Install dependencies
run: bun install --frozen-lockfile --os=${{ matrix.os }} --cpu=${{ matrix.cpu }}
- name: Build binary
run: bun scripts/build-binary.ts ${{ matrix.target }}
- name: Smoke test
if: matrix.target == 'linux-x64'
run: |
set -euo pipefail
runtime_dir="$(mktemp -d)"
HOME="$runtime_dir/home" XDG_DATA_HOME="$runtime_dir/xdg" release/${{ matrix.binary }} --version
HOME="$runtime_dir/home" XDG_DATA_HOME="$runtime_dir/xdg" release/${{ matrix.binary }} --smoke-test
- name: Upload binary
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: ${{ matrix.binary }}
path: runner/release/${{ matrix.binary }}
if-no-files-found: error