generated from sindresorhus/electron-boilerplate
-
-
Notifications
You must be signed in to change notification settings - Fork 104
176 lines (147 loc) Β· 4.79 KB
/
crossover-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
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
172
173
174
175
176
name: crossover-ci
on:
push:
branches:
- dev
- master
- release
jobs:
crossover-ci-mac:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
# install Bun
- uses: oven-sh/setup-bun@v1
# Make sure build is clean and no files from a previous run are re-used.
- name: Cleanup files before run
run: |
rm -rf *
if: ${{ always() }}
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it.
- name: Checkout Project
uses: actions/checkout@v2
# Check memory and cpu
- name: Verify Runner Resources
run: |
sysctl -n machdep.cpu.brand_string
vm_stat | perl -ne '/page size of (\d+)/ and $size=$1; /Pages\s+([^:]+)[^\d]+(\d+)/ and printf("%-16s % 16.2f Mi\n", "$1:", $2 * $size / 1048576);'
# - name: Install Tools
# run: |
# brew install jq
- name: Get Node Version
run: |
cat .nvmrc
echo "::set-output name=nodeversion::$(cat .nvmrc)"
id: get-node-version
- name: Use Node.js ${{ steps.get-node-version.outputs.nodeversion }}
uses: actions/setup-node@v2
with:
node-version: ${{ steps.get-node-version.outputs.nodeversion }}
cache: "npm"
- name: Install Dependencies
run: |
env
echo "node: $(node --version)"
echo "npm: $(npm --version)"
echo "yarn: $(yarn --version)"
npm install
- name: Lint
run: npm run lint
- name: Check Dependencies
run: npm run depcheck
- name: Unpackaged Test π§ͺ
run: npm run test
# - name: Build
# run: |
# npm run build:mac
# env:
# # Set CI flag to false, or the build fails on all warnings, not just errors as locally.
# CI: false
# - name: Package App
# run: |
# npm run pack
# # Check Binary Sizes
# - name: Build Succeeded
# run: |
# ls -alh dist | grep Monokle && du -sh dist/mac || true
# if: ${{ success() }}
# # - name: E2E Test for Electron π§ͺ
# # run: npm run test
- name: Upload Test Results π
if: always()
uses: actions/upload-artifact@v2
with:
name: dist
path: dist/*
crossover-ci-windows:
runs-on: windows-latest
steps:
# Make sure build is clean and no files from a previous run are re-used.
- name: Cleanup files before run
run: |
cmd /r dir
if: ${{ always() }}
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it.
- name: Checkout Project
uses: actions/checkout@v2
- name: Get Node Version
run: |
Set-PSDebug -Trace 1
$filePath = ".nvmrc"
Get-Content $filePath -Raw
$content = Get-Content $filePath -Raw
echo "::set-output name=nodeversion::$content"
id: get-node-version
- name: Use Node.js ${{ steps.get-node-version.outputs.nodeversion }}
uses: actions/setup-node@v2
with:
node-version: ${{ steps.get-node-version.outputs.nodeversion }}
cache: "npm"
# - name: Get MSFT Cert
# id: write_file
# uses: timheuer/base64-to-file@v1
# with:
# fileName: "kubeshop_msft.p12"
# encodedString: ${{ secrets.CERT_MSFT_KUBESHOP_P12_B64 }}
# Install Dependencies
- name: Install Dependencies
run: |
Set-PSDebug -Trace 1
node --version
npm --version
yarn --version
npm install
- name: Lint
run: npm run lint
- name: Check Dependencies
run: npm run depcheck
- name: Unpackaged Test π§ͺ
run: npm run test
# - name: Build
# run: |
# npm run build:windows
# env:
# # Set CI flag to false, or the build fails on all warnings, not just errors as locally.
# CI: false
# - name: Package
# run: |
# npm exec -c 'electron-builder --publish "never"'
# env:
# GITHUB_TOKEN: ${{ secrets.github_token }}
# WIN_CSC_LINK: ${{ steps.write_file.outputs.filePath }}
# WIN_CSC_KEY_PASSWORD: ${{ secrets.CERT_MSFT_KUBESHOP_P12_PASSWORD }}
# EP_PRE_RELEASE: true
# USE_HARD_LINKS: false
# # Check Binary Sizes
# - name: Build Succeeded
# run: |
# cmd /r dir .\dist
# if: ${{ success() }}
# - name: E2E Test for Electron π§ͺ
# run: npm run ui-test
# - name: Upload Test Results π
# if: always()
# uses: actions/upload-artifact@v2
# with:
# name: playwright-output
# path: test-output/**