forked from ember-learn/super-rentals-tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
112 lines (107 loc) · 3.79 KB
/
Copy pathbuild.yml
File metadata and controls
112 lines (107 loc) · 3.79 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
name: Build
on:
pull_request: {}
push:
branches:
- main
schedule:
- cron: '0 0 * * *'
workflow_dispatch: {}
jobs:
build:
name: Build (${{ matrix.channel }})
runs-on: ubuntu-latest
env:
CI: 'true'
strategy:
fail-fast: false
matrix:
channel:
- release
- beta
steps:
- name: Set up Git
run: |
git config --global user.name "Tomster"
git config --global user.email "tomster@emberjs.com"
- name: Checkout
uses: actions/checkout@v6
- uses: pnpm/action-setup@v4
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: '20'
cache: 'pnpm'
- name: Install dependencies (apt-get)
run: |
sudo apt-get update -y
sudo apt-get install -y tree
- name: Disable AppArmor
# Ubuntu >= 23 has AppArmor enabled by default, which breaks Puppeteer.
# See https://github.com/puppeteer/puppeteer/issues/12818 "No usable sandbox!"
# this is taken from the solution used in Puppeteer's own CI: https://github.com/puppeteer/puppeteer/pull/13196
# The alternative is to pin Ubuntu 22 or to use aa-exec to disable AppArmor for commands that need Puppeteer.
# This is also suggested by Chromium https://chromium.googlesource.com/chromium/src/+/main/docs/security/apparmor-userns-restrictions.md
run: echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns
- uses: actions/cache@v5
name: Setup cache for puppeteer
with:
# See .puppeteerrc.cjs, where we set this as the place puppeteer
# installs the browser. It needs to be cached the same as our pnpm
# packages are because it won't get reinstalled if our modules are
# cached.
path: .puppeteer-cache
key: ${{ runner.os }}-puppeteer-${{ hashFiles('**/pnpm-lock.yaml') }}
- name: Install dependencies (pnpm)
run: |
if [[ "$EMBER_RELEASE_CHANNEL" == "beta" ]]; then
pnpm upgrade ember-cli@beta
else
pnpm upgrade ember-cli
fi
pnpm install
env:
EMBER_RELEASE_CHANNEL: ${{ matrix.channel }}
- name: Lint (markdown source)
run: pnpm lint:md:src
- name: Lint (typescript)
run: pnpm lint:ts
- name: Compile (typescript)
run: pnpm tsc
- name: Generate
run: pnpm generate
- name: Lint (markdown output)
run: pnpm lint:md:dist
- name: Prune artifacts
if: always()
working-directory: dist/code/super-rentals
run: git clean -dfX
- name: Upload artifacts (assets)
uses: actions/upload-artifact@v4
if: always()
with:
name: assets (${{ matrix.channel }})
path: dist/assets
- name: Upload artifacts (markdown)
uses: actions/upload-artifact@v4
if: always()
with:
name: markdown (${{ matrix.channel }})
path: dist/markdown
- name: Upload artifacts (code)
uses: actions/upload-artifact@v4
if: always()
with:
name: code (${{ matrix.channel }})
path: dist/code/super-rentals
include-hidden-files: true
- name: Notify Discord # This is a step rather than a job because of the matrix
uses: sarisia/actions-status-discord@v1
if: ${{ failure() && github.event_name == 'schedule' }}
with:
webhook: ${{ secrets.CORE_META_WEBHOOK }}
status: "Failure"
title: "Super Rentals Tutorial Classic Build ${{ matrix.channel }}"
color: 0xcc0000
url: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
username: GitHub Actions