@internetarchive/bookreader 5.0.0-37 → 5.0.0-38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,7 +10,7 @@ on:
10
10
  branches: [ master ]
11
11
 
12
12
  jobs:
13
- build:
13
+ install:
14
14
  runs-on: ubuntu-latest
15
15
 
16
16
  steps:
@@ -18,7 +18,9 @@ jobs:
18
18
  - uses: actions/setup-node@v1
19
19
  with:
20
20
  node-version: 16.x
21
- - uses: actions/cache@v2
21
+ - name: Cache node_modules
22
+ uses: actions/cache@v2
23
+ id: cache
22
24
  with:
23
25
  # Caching node_modules isn't recommended because it can break across
24
26
  # Node versions and won't work with npm ci (See https://github.com/actions/cache/blob/main/examples.md#node---npm )
@@ -27,11 +29,71 @@ jobs:
27
29
  # `node_modules` directly.
28
30
  path: 'node_modules'
29
31
  key: ${{ runner.os }}-node-16-${{ hashFiles('package*.json') }}
30
- - run: npm install
31
- - run: npm run build
32
+ - if: steps.cache.outputs.cache-hit != 'true'
33
+ run: npm install
34
+
35
+ build:
36
+ needs: install
37
+ runs-on: ubuntu-latest
38
+ steps:
39
+ - uses: actions/checkout@v2
40
+ - uses: actions/setup-node@v1
41
+ with:
42
+ node-version: 16.x
43
+ - name: Load node_modules from cache
44
+ uses: actions/cache@v2
45
+ with:
46
+ # Use node_modules from previous jobs
47
+ path: 'node_modules'
48
+ key: ${{ runner.os }}-node-16-${{ hashFiles('package*.json') }}
49
+ - name: Cache BookReader/
50
+ uses: actions/cache@v2
51
+ id: build-cache
52
+ with:
53
+ # Cache the build files so we don't have to build twice for e2e tests
54
+ path: 'BookReader'
55
+ key: ${{ runner.os }}-${{ github.sha }}
56
+ - if: steps.build-cache.outputs.cache-hit != 'true'
57
+ run: npm run build
58
+
59
+ tests:
60
+ needs: install
61
+ runs-on: ubuntu-latest
62
+ steps:
63
+ - uses: actions/checkout@v2
64
+ - uses: actions/setup-node@v1
65
+ with:
66
+ node-version: 16.x
67
+ - name: Load node_modules from cache
68
+ uses: actions/cache@v2
69
+ with:
70
+ # Use node_modules from previous jobs
71
+ path: 'node_modules'
72
+ key: ${{ runner.os }}-node-16-${{ hashFiles('package*.json') }}
32
73
  - run: npm run lint
33
74
  - run: npm run test
34
75
  - run: npm run codecov
76
+
77
+ e2e-tests:
78
+ needs: build
79
+ runs-on: ubuntu-latest
80
+ steps:
81
+ - uses: actions/checkout@v2
82
+ - uses: actions/setup-node@v1
83
+ with:
84
+ node-version: 16.x
85
+ - name: Load node_modules from cache
86
+ uses: actions/cache@v2
87
+ with:
88
+ # Use node_modules from previous jobs
89
+ path: 'node_modules'
90
+ key: ${{ runner.os }}-node-16-${{ hashFiles('package*.json') }}
91
+ - name: Load BookReader/ from cache
92
+ uses: actions/cache@v2
93
+ with:
94
+ # Cache the build files so we don't have to build twice for e2e tests
95
+ path: 'BookReader'
96
+ key: ${{ runner.os }}-${{ github.sha }}
35
97
  # Travis machines usually have 2 cores (see https://docs.travis-ci.com/user/reference/overview/#virtualisation-environment-vs-operating-system )
36
98
  # Quarantine mode (sigh) to catch unstable tests (see https://devexpress.github.io/testcafe/documentation/guides/basic-guides/run-tests.html#quarantine-mode )
37
99
  - run: npx testcafe --concurrency 2 --quarantine-mode