-
Notifications
You must be signed in to change notification settings - Fork 335
73 lines (61 loc) · 2.47 KB
/
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
72
73
name: Test
on: [push, pull_request]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
fail-fast: false
steps:
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
# The vue I18next framework fixture tests rely on the documents getting recognized as `vue` documents by VSCode.
# We set the `file.association` in the tests' .vscode/settings.json. However, `vue` is not a language identifier
# that VSCode knows about by default, so those are ignored. It requires extensions to teach it about the `vue`
# identifier, otherwise it marks the files as `plaintext`, the vue I18next framework doesn't run, and the tests
# fail.
# Instead of installing a separate Vue extension just for this identifier, for the tests, we have i18n-ally itself
# tell VSCode about the `vue` language identifier.
- name: Register `vue` as a VSCode language identifier
if: runner.os != 'Windows'
run: 'contents="$(jq ''.contributes.languages += [{"id": "vue"}]'' package.json)" && echo -E "${contents}" > package.json'
- name: Install jq (Windows)
if: runner.os == 'Windows'
run: |
Invoke-WebRequest -Uri "https://github.com/stedolan/jq/releases/download/jq-1.6/jq-win64.exe" -OutFile "C:\jq.exe"
$env:Path += ";C:\"
- name: Register `vue` as a VSCode language identifier (Windows)
if: runner.os == 'Windows'
run: |
jq --ascii-output '.contributes.languages += [{\"id\": \"vue\"}]' package.json | Out-File -Encoding ascii "package.json.tmp"
Move-Item -Path package.json.tmp -Destination package.json -Force
shell: powershell
- name: Install
run: yarn install --frozen-lockfile
env:
CI: true
- name: Build
run: yarn build
env:
CI: true
- name: Unit Tests
run: yarn test:unit
env:
CI: true
- name: E2E Tests
run: yarn run test:e2e && yarn run test:fixture
if: runner.os != 'Linux'
env:
CI: true
- name: E2E Tests (Linux)
run: xvfb-run -a yarn run test:e2e && xvfb-run -a yarn run test:fixture
if: runner.os == 'Linux'
env:
CI: true