@@ -33,33 +33,7 @@ concurrency:
33
33
cancel-in-progress : true
34
34
35
35
jobs :
36
- diff :
37
- timeout-minutes : 2
38
- runs-on : ubuntu-latest
39
- name : " Diff files"
40
- outputs :
41
- runTest : ${{ steps.skip-tests-files.outputs.only_changed != 'true' }}
42
- steps :
43
- - name : Checkout
44
- uses : actions/checkout@v3
45
- with :
46
- # Assume PRs are less than 50 commits
47
- fetch-depth : 50
48
-
49
- - name : Get changed files
50
- id : skip-tests-files
51
- uses : tj-actions/changed-files@ea251d4d2f03a9c18841ae1b752f58b82dfb4d5e # v35.3.0
52
- with :
53
- files : |
54
- docs/**
55
- .github/**
56
- !.github/workflows/ci.yml
57
- packages/create-vite/template**
58
- **.md
59
-
60
36
test :
61
- needs : diff
62
- if : ${{ needs.diff.outputs.runTest }}
63
37
timeout-minutes : 20
64
38
runs-on : ${{ matrix.os }}
65
39
strategy :
@@ -78,34 +52,52 @@ jobs:
78
52
steps :
79
53
- name : Checkout
80
54
uses : actions/checkout@v3
55
+ with :
56
+ # Assume PRs are less than 50 commits
57
+ fetch-depth : 50
58
+
59
+ - name : Get changed files
60
+ id : changed-files
61
+ uses : tj-actions/changed-files@ea251d4d2f03a9c18841ae1b752f58b82dfb4d5e # v35.3.0
62
+ with :
63
+ files : |
64
+ docs/**
65
+ .github/**
66
+ !.github/workflows/ci.yml
67
+ packages/create-vite/template**
68
+ **.md
81
69
82
70
- name : Install pnpm
71
+ if : steps.changed-files.outputs.only_changed != 'true'
83
72
84
73
85
74
- name : Set node version to ${{ matrix.node_version }}
75
+ if : steps.changed-files.outputs.only_changed != 'true'
86
76
uses : actions/setup-node@v3
87
77
with :
88
78
node-version : ${{ matrix.node_version }}
89
79
cache : " pnpm"
90
80
91
81
- name : Install deps
82
+ if : steps.changed-files.outputs.only_changed != 'true'
92
83
run : pnpm install
93
84
94
85
# Install playwright's binary under custom directory to cache
95
86
- name : (non-windows) Set Playwright path and Get playwright version
96
- if : runner.os != 'Windows'
87
+ if : runner.os != 'Windows' && steps.changed-files.outputs.only_changed != 'true'
97
88
run : |
98
89
echo "PLAYWRIGHT_BROWSERS_PATH=$HOME/.cache/playwright-bin" >> $GITHUB_ENV
99
90
PLAYWRIGHT_VERSION="$(pnpm ls --depth 0 --json -w playwright-chromium | jq --raw-output '.[0].devDependencies["playwright-chromium"].version')"
100
91
echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV
101
92
- name : (windows) Set Playwright path and Get playwright version
102
- if : runner.os == 'Windows'
93
+ if : runner.os == 'Windows' && steps.changed-files.outputs.only_changed != 'true'
103
94
run : |
104
95
echo "PLAYWRIGHT_BROWSERS_PATH=$HOME\.cache\playwright-bin" >> $env:GITHUB_ENV
105
96
$env:PLAYWRIGHT_VERSION="$(pnpm ls --depth 0 --json -w playwright-chromium | jq --raw-output '.[0].devDependencies[\"playwright-chromium\"].version')"
106
97
echo "PLAYWRIGHT_VERSION=$env:PLAYWRIGHT_VERSION" >> $env:GITHUB_ENV
107
98
108
99
- name : Cache Playwright's binary
100
+ if : steps.changed-files.outputs.only_changed != 'true'
109
101
uses : actions/cache@v3
110
102
with :
111
103
key : ${{ runner.os }}-playwright-bin-v1-${{ env.PLAYWRIGHT_VERSION }}
@@ -114,19 +106,24 @@ jobs:
114
106
${{ runner.os }}-playwright-bin-v1-
115
107
116
108
- name : Install Playwright
109
+ if : steps.changed-files.outputs.only_changed != 'true'
117
110
# does not need to explicitly set chromium after https://github.com/microsoft/playwright/issues/14862 is solved
118
111
run : pnpm playwright install chromium
119
112
120
113
- name : Build
114
+ if : steps.changed-files.outputs.only_changed != 'true'
121
115
run : pnpm run build
122
116
123
117
- name : Test unit
118
+ if : steps.changed-files.outputs.only_changed != 'true'
124
119
run : pnpm run test-unit
125
120
126
121
- name : Test serve
122
+ if : steps.changed-files.outputs.only_changed != 'true'
127
123
run : pnpm run test-serve
128
124
129
125
- name : Test build
126
+ if : steps.changed-files.outputs.only_changed != 'true'
130
127
run : pnpm run test-build
131
128
132
129
lint :
0 commit comments