forked from microsoft/rushstack
-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (89 loc) · 3.48 KB
/
ci.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
name: CI
on:
push:
branches: ['main']
pull_request:
branches: ['main']
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
strategy:
matrix:
include:
# - NodeVersion: 16.20.x
# NodeVersionDisplayName: 16
# OS: ubuntu-latest
# - NodeVersion: 18.18.x
# NodeVersionDisplayName: 18
# OS: ubuntu-latest
- NodeVersion: 20.9.x
NodeVersionDisplayName: 20
OS: ubuntu-latest
# - NodeVersion: 18.18.x
# NodeVersionDisplayName: 18
# OS: windows-latest
name: Node.js v${{ matrix.NodeVersionDisplayName }} (${{ matrix.OS }})
runs-on: self-hosted
steps:
# - name: Create ~/.rush-user/settings.json
# shell: pwsh
# # Create a .rush-user/settings.json file that looks like this:
# #
# # { "buildCacheFolder": "/<runner working directory>/rush-cache" }
# #
# # This configures the local cache to be shared between all Rush repos. This allows us to run a build in
# # one clone of the repo (repo-a), and restore from the cache in another clone of the repo (repo-b) to test
# # the build cache.
# run: |
# mkdir -p $HOME/.rush-user
# @{ buildCacheFolder = Join-Path ${{ github.workspace }} rush-cache } | ConvertTo-Json > $HOME/.rush-user/settings.json
- name: Set cache environment variables
uses: gigara/rush-cache@v2
- uses: actions/checkout@v3
with:
fetch-depth: 2
path: repo-a
clean: false
- name: Git config user
run: |
git config --local user.name "Rushbot"
git config --local user.email "rushbot@users.noreply.github.com"
working-directory: repo-a
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.NodeVersion }}
# - name: Verify Change Logs
# run: node common/scripts/install-run-rush.js change --verify
# working-directory: repo-a
- name: Rush Install
run: node common/scripts/install-run-rush.js install
working-directory: repo-a
# - if: runner.os == 'Linux'
# name: Start xvfb
# run: /usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
# working-directory: repo-a
- name: Rush retest (install-run-rush)
# run: node common/scripts/install-run-rush.js build
run: node --inspect-brk common/temp/install-run/@microsoft+rush@5.125.0/node_modules/@microsoft/rush-lib/lib/start build
working-directory: repo-a
- name: Ensure repo README is up-to-date
run: node repo-scripts/repo-toolbox/lib/start.js readme --verify
working-directory: repo-a
- name: Clone another copy of the repo to test the build cache
uses: actions/checkout@v3
with:
fetch-depth: 1
path: repo-b
clean: false
- name: Git config user
run: |
git config --local user.name "Rushbot"
git config --local user.email "rushbot@users.noreply.github.com"
working-directory: repo-b
- name: Rush update (rush-lib)
run: node ${{ github.workspace }}/repo-a/apps/rush/lib/start-dev.js update
working-directory: repo-b
- name: Rush test (rush-lib)
run: node ${{ github.workspace }}/repo-a/apps/rush/lib/start-dev.js test --verbose --production --timeline
working-directory: repo-b