-
Notifications
You must be signed in to change notification settings - Fork 454
87 lines (78 loc) · 3.25 KB
/
build-web-tools-reusable.yml
File metadata and controls
87 lines (78 loc) · 3.25 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
name: "[Web] - Build - Called"
on:
workflow_call:
workflow_dispatch:
inputs:
ref:
description: |
If you run this manually, and want to run on a PR, the correct ref should be refs/pull/{PR_NUMBER}/merge to
have the "normal" scenario involving checking out a merge commit between your branch and the base branch.
If you want to run only on a branch or specific commit, you can use either the sha or the branch name instead (prefer the first verion for PRs).
required: false
permissions:
id-token: write
contents: read
jobs:
build-web-tools:
name: "Web Tools Build"
env:
NODE_OPTIONS: "--max-old-space-size=7168"
FORCE_COLOR: 3
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
ref: ${{ inputs.ref || github.sha }}
- name: Setup the caches
uses: LedgerHQ/ledger-live/tools/actions/composites/setup-caches@develop
id: setup-caches
with:
install-proto: true
skip-turbo-cache: "false"
accountId: ${{ secrets.AWS_ACCOUNT_ID_PROD }}
roleName: ${{ secrets.AWS_CACHE_ROLE_NAME }}
region: ${{ secrets.AWS_CACHE_REGION }}
turbo-server-token: ${{ secrets.TURBOREPO_SERVER_TOKEN }}
- name: Install dependencies
run: pnpm i -F "web-tools..." -F "ledger-live"
- name: build web-tools
run: pnpm turbo run build --filter="@ledgerhq/web-tools" --api="http://127.0.0.1:${{ steps.setup-caches.outputs.port }}" --token="${{ secrets.TURBOREPO_SERVER_TOKEN }}" --team="foo"
- name: typecheck web-tools
run: pnpm turbo run typecheck --filter="@ledgerhq/web-tools" --api="http://127.0.0.1:${{ steps.setup-caches.outputs.port }}" --token="${{ secrets.TURBOREPO_SERVER_TOKEN }}" --team="foo"
report:
needs: build-web-tools
name: "Web Tools Build > Report"
if: ${{ !cancelled() && github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-22.04
steps:
- uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
pattern: outputs-*
merge-multiple: true
path: outputs
- uses: actions/github-script@v6
name: build summary
with:
script: |
const fs = require("fs");
const statuses = {
tool: {
pass: ${{ needs.build-web-tools.result == 'success' }},
status: "${{ needs.build-web-tools.result }}",
}
};
const summary = `### Web Tools
${statuses.tool.pass ? "Web Tools are fine" : "Web Tools build or typecheck failed"}
- ${statuses.tool.pass ? "✅" : "❌"} **Web Tools** ended with status \`${statuses.tool.status}\`
`;
const actions = [];
const output = {
summary,
actions
};
fs.writeFileSync("summary-web-tools.json", JSON.stringify(output), "utf-8");
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
name: Upload output
with:
path: ${{ github.workspace }}/summary-web-tools.json
name: summary-web-tools.json