forked from prettier/prettier
83 lines (73 loc) · 2.12 KB
/
dev-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
74
75
76
77
78
79
80
81
82
83
name: Dev
on:
push:
branches:
- master
- patch-release
pull_request:
jobs:
test:
strategy:
fail-fast: false
matrix:
os:
- "ubuntu-latest"
- "macos-latest"
- "windows-latest"
node:
- "13"
- "12"
- "10"
include:
# only enable coverage on the fastest job
- os: "ubuntu-latest"
node: "12"
ENABLE_CODE_COVERAGE: true
exclude:
- os: "macos-latest"
node: "13"
env:
ENABLE_CODE_COVERAGE: ${{ matrix.ENABLE_CODE_COVERAGE }}
name: Node.js ${{ matrix.node }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- name: Install Dependencies
run: yarn install --frozen-lockfile
# TODO: remove this task when/if this fixed
# https://github.com/facebook/jest/issues/9457
- name: Install jest@24
if: matrix.ENABLE_CODE_COVERAGE
run: yarn upgrade jest@24
- name: Run Tests (macOS)
if: matrix.os == 'macos-latest'
run: yarn test --maxWorkers=4
- name: Run Tests (Linux and Windows)
if: matrix.os != 'macos-latest'
run: yarn test --maxWorkers=2
- name: Upload Coverage
uses: codecov/codecov-action@v1
if: matrix.ENABLE_CODE_COVERAGE
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage/lcov.info
fail_ci_if_error: true
# #8073 test
- name: Run Tests (PRETTIER_FALLBACK_RESOLVE)
run: yarn test "tests_integration/__tests__/(config|plugin)"
env:
PRETTIER_FALLBACK_RESOLVE: true
- name: Upload Coverage (PRETTIER_FALLBACK_RESOLVE)
uses: codecov/codecov-action@v1
if: matrix.ENABLE_CODE_COVERAGE
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage/lcov.info
fail_ci_if_error: true