generated from threeal/action-starter
-
Notifications
You must be signed in to change notification settings - Fork 1
150 lines (128 loc) · 3.48 KB
/
test.yaml
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
name: Test
on:
workflow_dispatch:
pull_request:
push:
branches: [main]
jobs:
test-package:
name: Test Package
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4.2.2
- name: Setup Node.js
uses: actions/setup-node@v4.1.0
with:
node-version-file: .nvmrc
- name: Setup Yarn
uses: threeal/setup-yarn-action@v2.0.0
- name: Test Package
run: yarn test
test-action:
name: Test Action
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, macos-14, windows-2022]
steps:
- name: Checkout Package
uses: actions/checkout@v4.2.2
with:
repository: threeal/nodejs-starter
- name: Checkout Action
uses: actions/checkout@v4.2.2
with:
path: setup-yarn-action
sparse-checkout: |
action.yml
dist
sparse-checkout-cone-mode: false
- name: Setup Yarn
uses: ./setup-yarn-action
- name: Build Package
run: yarn pack
test-action-with-specific-version:
name: Test Action With Specific Version
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, macos-14, windows-2022]
steps:
- name: Checkout Package
uses: actions/checkout@v4.2.2
with:
repository: threeal/nodejs-starter
ref: v1.0.0
- name: Alter Package
shell: bash
run: jq 'del(.packageManager)' package.json > package.json.tmp && mv package.json.tmp package.json
- name: Checkout Action
uses: actions/checkout@v4.2.2
with:
path: setup-yarn-action
sparse-checkout: |
action.yml
dist
sparse-checkout-cone-mode: false
- name: Setup Yarn
uses: ./setup-yarn-action
with:
version: 4.0.2
- name: Check Version
shell: bash
run: test $(yarn --version) == 4.0.2
- name: Build Package
run: yarn pack
test-action-without-cache:
name: Test Action Without Cache
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, macos-14, windows-2022]
steps:
- name: Checkout Package
uses: actions/checkout@v4.2.2
with:
repository: threeal/nodejs-starter
- name: Checkout Action
uses: actions/checkout@v4.2.2
with:
path: setup-yarn-action
sparse-checkout: |
action.yml
dist
sparse-checkout-cone-mode: false
- name: Setup Yarn
uses: ./setup-yarn-action
with:
cache: false
- name: Build Package
run: yarn pack
test-action-with-yarn-local-cache:
name: Test Action With Yarn Local Cache
runs-on: ubuntu-24.04
steps:
- name: Checkout Package
uses: actions/checkout@v4.2.2
with:
repository: threeal/nodejs-starter
- name: Checkout Action
uses: actions/checkout@v4.2.2
with:
path: setup-yarn-action
sparse-checkout: |
action.yml
dist
sparse-checkout-cone-mode: false
- name: Disable Yarn Global Cache
run: |
corepack enable yarn
yarn config set enableGlobalCache false
- name: Setup Yarn
uses: ./setup-yarn-action
- name: Build Package
run: yarn pack