-
Notifications
You must be signed in to change notification settings - Fork 3
71 lines (58 loc) · 2.25 KB
/
build-and-test.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
name: Build & Test
on: [push]
jobs:
build:
runs-on: windows-2022
timeout-minutes: 20
steps:
- uses: actions/checkout@v3
- name: Setup Visual Studio Development Environment
uses: compnerd/gha-setup-vsdevenv@main
- name: Install Swift
uses: compnerd/gha-setup-swift@main
with:
branch: development
tag: DEVELOPMENT-SNAPSHOT-2023-05-20-a
# long file path support needed for building tests, the dependencies
# that SPM checks out end up having paths which are too long. this can't
# be locally set bc the SPM checkouts aren't part of this repo
- name: Configure long file path
shell: pwsh
run: git config --system core.longpaths true
- name: Enable crash dump in Registry
working-directory: ${{ github.workspace }}
shell: pwsh
run: |
curl -H "Authorization: token ${{ inputs.GITHUB_TOKEN }}" -H "Accept: application/vnd.github.v4.raw" -O -L https://api.github.com/repos/thebrowsercompany/infra/contents/resources/windows/ErrorReporting.reg
regedit.exe /s ErrorReporting.reg
- name: Start WinAppDriver
shell: pwsh
run: |
cmd /c 'START "winappdriver" "C:\Program Files (x86)\Windows Application Driver\WinAppDriver.exe" "127.0.0.1" "4723"'
- name: Build
uses: ./.github/actions/windows-run-and-flush
with:
cmd-exec: swift
working-directory: ${{ github.workspace }}
cmd-args: "build ${{ runner.debug && '--verbose' || '' }} --disable-keychain --build-tests"
- name: Test
timeout-minutes: 10
uses: ./.github/actions/windows-run-and-flush
with:
cmd-exec: swift
working-directory: ${{ github.workspace }}
cmd-args: "test ${{ runner.debug && '--verbose' || '' }} --disable-keychain --skip-build"
- name: Take screenshot
if: failure()
continue-on-error: true
shell: pwsh
run: |
${{ github.workspace }}\scripts\screenshot.ps1 ${{ github.workspace }}\screenshot.png
- uses: actions/upload-artifact@v3
if: failure()
with:
name: screenshot
path: ${{ github.workspace }}\screenshot.png
- uses: ./.github/actions/windows-swift-teardown
with:
working-directory: ${{ github.workspace }}