1010 branches :
1111 - release-* # all release-<version> branches
1212
13-
1413jobs :
1514 # STEP 1 - NPM Audit
1615
@@ -23,13 +22,13 @@ jobs:
2322 runs-on : ubuntu-latest
2423
2524 steps :
26- - uses : actions/checkout@v3
27- - uses : actions/setup-node@v3
28- with :
29- node-version : 20
30- # install to create local package-lock.json but don't cache the files
31- # also: no audit for dev dependencies
32- - run : npm i --package-lock-only && npm audit --production
25+ - uses : actions/checkout@v3
26+ - uses : actions/setup-node@v3
27+ with :
28+ node-version : 20
29+ # install to create local package-lock.json but don't cache the files
30+ # also: no audit for dev dependencies
31+ - run : npm i --package-lock-only && npm audit --production
3332
3433 # STEP 2 - basic unit tests
3534
@@ -40,34 +39,34 @@ jobs:
4039 needs : [audit]
4140 strategy :
4241 matrix :
43- node : [14, 16, 18]
42+ node : [16, 18, 20 ]
4443 steps :
45- - name : Checkout ${{ matrix.node }}
46- uses : actions/checkout@v3
47-
48- - name : Setup node ${{ matrix.node }}
49- uses : actions/setup-node@v3
50- with :
51- node-version : ${{ matrix.node }}
52-
53- - name : Cache dependencies ${{ matrix.node }}
54- uses : actions/cache@v3
55- with :
56- path : ~/.npm
57- key : ${{ runner.os }}-node-${{ matrix.node }}-${{ hashFiles('**/package-lock.json') }}
58- restore-keys : |
59- ${{ runner.os }}-node-${{ matrix.node }}
60- # for this workflow we also require npm audit to pass
61- - run : npm i
62- - run : npm run test:coverage
63-
64- # with the following action we enforce PRs to have a high coverage
65- # and ensure, changes are tested well enough so that coverage won't fail
66- - name : check coverage
67- uses : VeryGoodOpenSource/very_good_coverage@v1.2.0
68- with :
69- path : ' ./coverage/lcov.info'
70- min_coverage : 95
44+ - name : Checkout ${{ matrix.node }}
45+ uses : actions/checkout@v3
46+
47+ - name : Setup node ${{ matrix.node }}
48+ uses : actions/setup-node@v3
49+ with :
50+ node-version : ${{ matrix.node }}
51+
52+ - name : Cache dependencies ${{ matrix.node }}
53+ uses : actions/cache@v3
54+ with :
55+ path : ~/.npm
56+ key : ${{ runner.os }}-node-${{ matrix.node }}-${{ hashFiles('**/package-lock.json') }}
57+ restore-keys : |
58+ ${{ runner.os }}-node-${{ matrix.node }}
59+ # for this workflow we also require npm audit to pass
60+ - run : npm i
61+ - run : npm run test:coverage
62+
63+ # with the following action we enforce PRs to have a high coverage
64+ # and ensure, changes are tested well enough so that coverage won't fail
65+ - name : check coverage
66+ uses : VeryGoodOpenSource/very_good_coverage@v1.2.0
67+ with :
68+ path : ' ./coverage/lcov.info'
69+ min_coverage : 95
7170
7271 # STEP 3 - Integration tests
7372
@@ -80,41 +79,41 @@ jobs:
8079 needs : [unittest]
8180 strategy :
8281 matrix :
83- node : [14, 16, 18] # TODO get running for node 16+
82+ node : [16, 18, 20 ] # TODO get running for node 16+
8483 steps :
85- # checkout this repo
86- - name : Checkout ${{ matrix.node }}
87- uses : actions/checkout@v3
88-
89- # checkout express-adapter repo
90- - name : Checkout express-adapter ${{ matrix.node }}
91- uses : actions/checkout@v3
92- with :
93- repository : node-oauth/express-oauth-server
94- path : github/testing/express
95-
96- - name : Setup node ${{ matrix.node }}
97- uses : actions/setup-node@v3
98- with :
99- node-version : ${{ matrix.node }}
100-
101- - name : Cache dependencies ${{ matrix.node }}
102- uses : actions/cache@v3
103- with :
104- path : ~/.npm
105- key : ${{ runner.os }}-node-${{ matrix.node }}-node-oauth/express-oauth-server-${{ hashFiles('github/testing/express/**/package-lock.json') }}
106- restore-keys : |
107- ${{ runner.os }}-node-${{ matrix.node }}-node-oauth/express-oauth-server
108-
109- # in order to test the adapter we need to use the current checkout
110- # and install it as local dependency
111- # we just cloned and install it as local dependency
112- # xxx: added bluebird as explicit dependency
113- - run : |
114- cd github/testing/express
115- npm i
116- npm install https://github.com/node-oauth/node-oauth2-server.git#${{ github.ref_name }}
117- npm run test
84+ # checkout this repo
85+ - name : Checkout ${{ matrix.node }}
86+ uses : actions/checkout@v3
87+
88+ # checkout express-adapter repo
89+ - name : Checkout express-adapter ${{ matrix.node }}
90+ uses : actions/checkout@v3
91+ with :
92+ repository : node-oauth/express-oauth-server
93+ path : github/testing/express
94+
95+ - name : Setup node ${{ matrix.node }}
96+ uses : actions/setup-node@v3
97+ with :
98+ node-version : ${{ matrix.node }}
99+
100+ - name : Cache dependencies ${{ matrix.node }}
101+ uses : actions/cache@v3
102+ with :
103+ path : ~/.npm
104+ key : ${{ runner.os }}-node-${{ matrix.node }}-node-oauth/express-oauth-server-${{ hashFiles('github/testing/express/**/package-lock.json') }}
105+ restore-keys : |
106+ ${{ runner.os }}-node-${{ matrix.node }}-node-oauth/express-oauth-server
107+
108+ # in order to test the adapter we need to use the current checkout
109+ # and install it as local dependency
110+ # we just cloned and install it as local dependency
111+ # xxx: added bluebird as explicit dependency
112+ - run : |
113+ cd github/testing/express
114+ npm i
115+ npm install https://github.com/node-oauth/node-oauth2-server.git#${{ github.ref_name }}
116+ npm run test
118117
119118 # todo repeat with other adapters
120119
@@ -139,13 +138,13 @@ jobs:
139138 contents : read
140139 packages : write
141140 steps :
142- - uses : actions/checkout@v3
143- - uses : actions/setup-node@v3
144- with :
145- # we always publish targeting the lowest supported node version
146- node-version : 16
147- registry-url : $registry-url(npm)
148- - run : npm i
149- - run : npm publish --dry-run
150- env :
151- NODE_AUTH_TOKEN : ${{secrets.GITHUB_TOKEN}}
141+ - uses : actions/checkout@v3
142+ - uses : actions/setup-node@v3
143+ with :
144+ # we always publish targeting the lowest supported node version
145+ node-version : 16
146+ registry-url : $registry-url(npm)
147+ - run : npm i
148+ - run : npm publish --dry-run
149+ env :
150+ NODE_AUTH_TOKEN : ${{secrets.GITHUB_TOKEN}}
0 commit comments