forked from angular/angular-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
78 lines (67 loc) · 2.86 KB
/
action.yml
File metadata and controls
78 lines (67 loc) · 2.86 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
name: 'Native Windows Bazel e2e test'
description: 'Runs an Angular CLI e2e Bazel test on native Windows (dispatched from inside WSL)'
author: 'Angular'
inputs:
test_target_name:
description: E2E test target name
required: true
test_args:
description: |
Text representing the command line arguments that
should be passed to the e2e test runner.
required: false
default: ''
runs:
using: composite
steps:
- name: Initialize WSL
id: init_wsl
uses: angular/dev-infra/github-actions/setup-wsl@f0289062692ca0af149a1bb61cc075a532003f49
with:
wsl_firewall_interface: 'vEthernet (WSL (Hyper-V firewall))'
- name: Installing pnpm (in WSL)
run: npm install -g pnpm@9
shell: wsl-bash {0}
- name: Install node modules in WSL (re-using from previous install/cache restore)
run: |
cd ${{steps.init_wsl.outputs.repo_path}}
pnpm install --frozen-lockfile
shell: wsl-bash {0}
- name: Build test binary for Windows (inside WSL)
shell: wsl-bash {0}
run: |
cd ${{steps.init_wsl.outputs.repo_path}}
pnpm bazel \
build --config=e2e //tests/legacy-cli:${{inputs.test_target_name}} --platforms=tools:windows_x64
env:
# See: https://devblogs.microsoft.com/commandline/share-environment-vars-between-wsl-and-windows
WSLENV: 'GOOGLE_APPLICATION_CREDENTIALS/p'
- name: Copying binary artifact to host
shell: wsl-bash {0}
run: |
cd ${{steps.init_wsl.outputs.repo_path}}
tar -cf /tmp/test.tar.gz dist/bin/tests/legacy-cli/${{inputs.test_target_name}}_
mkdir /mnt/c/test
mv /tmp/test.tar.gz /mnt/c/test
(cd /mnt/c/test && tar -xf /mnt/c/test/test.tar.gz)
- name: Convert symlinks for Windows host
shell: wsl-bash {0}
run: |
cd ${{steps.init_wsl.outputs.repo_path}}
runfiles_dir="/mnt/c/test/dist/bin/tests/legacy-cli/${{inputs.test_target_name}}_/${{inputs.test_target_name}}.bat.runfiles"
# Make WSL symlinks compatible on Windows native file system.
node scripts/windows-testing/convert-symlinks.mjs $runfiles_dir "${{steps.init_wsl.outputs.cmd_path}}"
# Needed for resolution because Aspect/Bazel looks for repositories at `<workspace>/external`.
# TODO(devversion): consult with Aspect on why this is needed.
(cd $runfiles_dir/_main && ${{steps.init_wsl.outputs.cmd_path}} /C "mklink /D external ..")
- name: Run tests
# Note: This is Git Bash.
shell: bash
env:
BAZEL_BINDIR: '.'
working-directory: "C:\\test"
run: |
node "${{github.workspace}}\\scripts\\windows-testing\\parallel-executor.mjs" \
$PWD/dist/bin/tests/legacy-cli/${{inputs.test_target_name}}_/${{inputs.test_target_name}}.bat.runfiles \
${{inputs.test_target_name}} \
"${{inputs.test_args}}" \