-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (86 loc) · 2.48 KB
/
push-any-build-3-jobs.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
# 1) Checkoput, install Node.js, Turborepo CLI, deps and Lint
# 2a) Build
# 2b) Test
name: Push to any - 3 Jobs
run-name: Lint, Build, Test
on:
# push:
# branches-ignore:
# - main
workflow_dispatch:
# env:
# To use Remote Caching, uncomment the next lines and follow the steps below.
jobs:
checkout_install_lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/[email protected]
with:
fetch-depth: 2
- name: Install Node.js v20.10
uses: actions/[email protected]
with:
node-version: '20.10'
- name: Get node version
id: node
run: |
echo "::set-output name=version::$(node -v)"
- name: Get node_modules cache
uses: actions/[email protected]
# id: node_modules
with:
path: |
**/node_modules
# Adding node version as cache key
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }}-${{ steps.node.outputs.version }}
- name: Install dependencies
run: yarn
- name: Lint
run: yarn lint
build:
runs-on: ubuntu-latest
needs: checkout_install_lint
steps:
- name: Checkout code
uses: actions/[email protected]
with:
fetch-depth: 2
- name: Install Node.js v20.10
uses: actions/[email protected]
with:
node-version: '20.10'
- name: Get node_modules cache
uses: actions/[email protected]
# id: node_modules
with:
path: |
**/node_modules
# Adding node version as cache key
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }}-${{ steps.node.outputs.version }}
- name: Build
run: |
yarn build
# test:
# runs-on: ubuntu-latest
# needs: checkout_install_lint
# steps:
# - name: Checkout code
# uses: actions/[email protected]
# with:
# fetch-depth: 2
# - name: Install Node.js v20.10
# uses: actions/[email protected]
# with:
# node-version: '20.10'
# - name: Get node_modules cache
# uses: actions/[email protected]
# # id: node_modules
# with:
# path: |
# **/node_modules
# # Adding node version as cache key
# key: ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }}-${{ steps.node.outputs.version }}
# - name: Test
# run: |
# yarn test