-
Notifications
You must be signed in to change notification settings - Fork 37
57 lines (47 loc) · 1.12 KB
/
11-artifacts-caching.yml
File metadata and controls
57 lines (47 loc) · 1.12 KB
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
name: 11 Artifacts and Caching
on:
workflow_dispatch:
push:
branches: [main]
paths:
- 'node-example/**'
pull_request:
branches: [main]
paths:
- 'node-example/**'
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: node-example
steps:
- uses: actions/checkout@v6.0.2
- name: Setup Node.js with caching
uses: actions/setup-node@v6
with:
node-version: 20
cache: 'npm'
cache-dependency-path: node-example/package-lock.json
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm test
- name: Upload test results
if: always()
uses: actions/upload-artifact@v7
with:
name: test-results
path: node-example/
retention-days: 5
download:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download test results
uses: actions/download-artifact@v8
with:
name: test-results
path: results
- name: Display retrieved artifact
run: ls -la results/