Skip to content

Commit cc99729

Browse files
sombraSoftfilipepacheco
authored andcommitted
created CI job
1 parent 7640e31 commit cc99729

File tree

1 file changed

+29
-18
lines changed

1 file changed

+29
-18
lines changed

.github/workflows/ci.yml

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,33 @@ jobs:
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
# Check out the source
15-
- name: Checkout Source
16-
uses: actions/checkout@v4
17-
# Setup node.js and cache
18-
- name: "Setup node.js"
19-
uses: actions/setup-node@v4
14+
- uses: actions/checkout@v4
15+
16+
- name: Cache node modules
17+
id: cache-npm
18+
uses: actions/cache@v3
19+
20+
env:
21+
cache-name: cache-node-modules
2022
with:
21-
node-version: "18.x"
22-
cache: 'npm'
23-
cache-dependency-path: ./package-lock.json
24-
# Install dependencies
25-
- name: Install dependencies
26-
run: npm ci
27-
# Lint App
28-
- name: Lint App
29-
run: npm run lint:ci
30-
# Build App
31-
- name: Build App
32-
run: npm run build
23+
# npm cache files are stored in `~/.npm` on Linux/macOS
24+
path: ~/.npm
25+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
26+
restore-keys: |
27+
${{ runner.os }}-build-${{ env.cache-name }}-
28+
${{ runner.os }}-build-
29+
${{ runner.os }}-
30+
31+
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
32+
name: List the state of node modules
33+
continue-on-error: true
34+
run: npm list
35+
36+
- name: NPM install
37+
run: npm install
38+
39+
- name: Build
40+
run: npm run build
41+
42+
- name: Lint & Format
43+
run: npm run lint

0 commit comments

Comments
 (0)