-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Copy pathaction.yml
171 lines (156 loc) · 5.42 KB
/
action.yml
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
name: Setup Test Environment
description: Composable Action for ensuring speedy test setup
inputs:
## Disables TurboCache
DISABLE_TURBO_CACHE:
description: Whether to disable TurboCache
required: false
default: false
ACTIONS_RUNNER_DEBUG:
description: Whether to enable debug mode
required: false
default: false
## Speeds Up Lint by enabling reuse
restore-lint-caches:
description: Whether to restore lint caches
required: false
default: false
## Speeds Up Build of bigger apps by enabling reuse
restore-broccoli-cache:
description: Whether to restore broccoli
required: false
default: false
use-production-caches:
description: Whether to restore from production caches
required: false
default: false
install:
description: Whether to install dependencies
required: false
default: false
skip-addon-build:
description: Whether to skip the prepare step for in-repo v2 addons when running pnpm install
required: false
default: false
adtl-install-args:
description: additional args to pass to pnpm install
required: false
default: ''
parallel-build:
description: Whether to build in parallel
required: false
default: true
## Set to same as number of cores
## 2 for ubuntu-latest (default)
jobs:
description: How many Build Jobs to Run
required: false
default: 4
ref:
description: Ref to Setup
required: false
default: ${{ github.sha }}
repo-token:
description: Token to use for TurboRepo
required: false
default: ''
with-cert:
description: Whether to setup an SSL Cert
required: false
default: false
runs:
using: composite
steps:
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
- uses: actions/setup-node@v4
with:
registry-url: 'https://registry.npmjs.org'
node-version-file: 'package.json'
cache: 'pnpm'
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: DEBUG STATUS
shell: bash
run:
echo "DISABLE_TURBO_CACHE = ${{ inputs.DISABLE_TURBO_CACHE }}"
echo "ACTIONS_RUNNER_DEBUG = ${{ inputs.ACTIONS_RUNNER_DEBUG }}"
echo "restore-lint-caches = ${{ inputs.restore-lint-caches }}"
echo "restore-broccoli-cache = ${{ inputs.restore-broccoli-cache }}"
- name: 'Setup local TurboRepo server'
if: ${{ inputs.repo-token }}
uses: felixmosh/turborepo-gh-artifacts@v3
with:
repo-token: ${{ inputs.repo-token }}
- name: Set Up Homebrew
if: ${{ inputs.with-cert }}
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: 'Setup SSL Cert Infra'
if: ${{ inputs.with-cert }}
shell: bash
run: |
sudo apt-get -y update
sudo apt install libnss3-tools
brew install mkcert
- name: 'Setup DBus for Chrome'
shell: bash
run: |
echo "DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus" >> $GITHUB_ENV
- name: Configure Parallel Builds
if: ${{ inputs.parallel-build == 'true' }}
shell: bash
run: |
echo "JOBS=${{ inputs.jobs }}" >> $GITHUB_ENV
echo "THROW_UNLESS_PARALLELIZABLE=1" >> $GITHUB_ENV
- name: Install Dependencies
if: ${{ inputs.install == 'true' && inputs.skip-addon-build == 'false' }}
shell: bash
run: pnpm install --prefer-offline $ADTL_ARGS
env:
ADTL_ARGS: ${{ inputs.adtl-install-args }}
TURBO_FORCE: ${{ inputs.DISABLE_TURBO_CACHE == 'true' }}
- name: Install Dependencies w/o Addon Builds
if: ${{ inputs.install == 'true' && inputs.skip-addon-build == 'true' }}
shell: bash
run: pnpm install --prefer-offline --ignore-scripts $ADTL_ARGS
env:
ADTL_ARGS: ${{ inputs.adtl-install-args }}
- name: 'Generate SSL Cert'
if: ${{ inputs.with-cert }}
shell: bash
# Generates the cert if needed, using our local copy of @warp-drive/holodeck
run: |
node ./packages/holodeck/server/ensure-cert.js
- name: Setup Broccoli Caching
if: ${{ inputs.restore-broccoli-cache == 'true' }}
shell: bash
run: |
echo "FORCE_PERSISTENCE_IN_CI=true" >> $GITHUB_ENV
echo "BROCCOLI_PERSISTENT_FILTER_CACHE_ROOT=${{ github.workspace }}/.broccoli-cache" >> $GITHUB_ENV
- name: Restore Broccoli Cache
if: ${{ inputs.restore-broccoli-cache == 'true' }}
uses: actions/cache@v4
with:
path: |
${{ github.workspace }}/.broccoli-cache
node_modules/.cache
tests/main/node_modules/.cache
key: broccoli${{inputs.use-production-caches == 'true' && '-production-' || '-'}}${{ github.head_ref }}-${{inputs.ref }}
restore-keys: |
broccoli${{inputs.use-production-caches == 'true' && '-production-' || '-'}}${{ github.head_ref }}
broccoli${{inputs.use-production-caches == 'true' && '-production-' || '-'}}${{ github.base_ref }}
broccoli${{inputs.use-production-caches == 'true' && '-production-' || '-'}}main
- name: Restore Lint Caches
if: ${{ inputs.restore-lint-caches == 'true' }}
uses: actions/cache@v4
with:
path: |
.eslintcache
.prettier-cache
tsconfig.tsbuildinfo
key: lint-${{ github.head_ref }}-${{ inputs.ref }}
restore-keys: |
lint-${{ github.head_ref }}
lint-${{ github.base_ref }}
lint-main