-
Notifications
You must be signed in to change notification settings - Fork 0
154 lines (141 loc) · 4.81 KB
/
melinda-node-tests.yml
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# Melinda node tests
name: Melinda node tests
on: push
jobs:
build-node-versions:
name: Node version matrix
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [18.x, 20.x, 22.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- name: Checkout the code
uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
env:
NPM_CONFIG_IGNORE_SCRIPTS: true
- run: npm audit --package-lock-only --production --audit-level=high
- run: npm ci
- run: npm test
- run: npm run build --if-present
license-scan:
name: License compliance check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: mikaelvesavuori/[email protected]
with:
exclude_pattern: /^@natlibfi/
njsscan:
name: Njsscan check
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: actions/checkout@v4
- name: nodejsscan scan
id: njsscan
uses: ajinabraham/njsscan-action@master
with:
args: '.'
quayio:
name: Quay.io image builder & publisher
needs: [build-node-versions, njsscan]
runs-on: ubuntu-latest
if: github.actor!= 'dependabot[bot]' # ignore the pull request which comes from user dependabot, because it does not access to secrets
steps:
- uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: quay.io/${{ github.repository }}
tags: |
type=raw,value=latest,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }}
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Login to Quay.io
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.MELINDA_QUAY_IO_USERNAME }}
password: ${{ secrets.MELINDA_QUAY_IO_PASSWORD }}
- name: Build and publish image to Quay.io
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
openshift-webhook:
name: OpenShift webhook for image builder
needs: [build-node-versions, njsscan]
runs-on: ubuntu-latest
steps:
- name: Production bib webhook
uses: joelwmale/webhook-action@master
if: github.ref == 'refs/heads/main'
with:
url: ${{ secrets.WEBHOOK_URL_BIB_PROD_FROM_MAIN }}
body: '{}'
- name: Production aut-aux webhook
uses: joelwmale/webhook-action@master
if: github.ref == 'refs/heads/main'
with:
url: ${{ secrets.WEBHOOK_URL_AUT_AUX_PROD_FROM_MAIN }}
body: '{}'
- name: Production aut-names webhook
uses: joelwmale/webhook-action@master
if: github.ref == 'refs/heads/main'
with:
url: ${{ secrets.WEBHOOK_URL_AUT_NAMES_PROD_FROM_MAIN }}
body: '{}'
- name: Production aut-subjects webhook
uses: joelwmale/webhook-action@master
if: github.ref == 'refs/heads/main'
with:
url: ${{ secrets.WEBHOOK_URL_AUT_SUBJECTS_PROD_FROM_MAIN }}
body: '{}'
- name: Production aut-works webhook
uses: joelwmale/webhook-action@master
if: github.ref == 'refs/heads/main'
with:
url: ${{ secrets.WEBHOOK_URL_AUT_WORKS_PROD_FROM_MAIN }}
body: '{}'
- name: Test aut aux webhook
uses: joelwmale/webhook-action@master
if: github.ref == 'refs/heads/test'
with:
url: ${{ secrets.WEBHOOK_URL_AUT_AUX_TEST_FROM_TEST }}
body: '{}'
- name: Test aut names webhook
uses: joelwmale/webhook-action@master
if: github.ref == 'refs/heads/test'
with:
url: ${{ secrets.WEBHOOK_URL_AUT_NAMES_TEST_FROM_TEST }}
body: '{}'
- name: Test aut subjects webhook
uses: joelwmale/webhook-action@master
if: github.ref == 'refs/heads/test'
with:
url: ${{ secrets.WEBHOOK_URL_AUT_SUBJECTS_TEST_FROM_TEST }}
body: '{}'
- name: Test aut works webhook
uses: joelwmale/webhook-action@master
if: github.ref == 'refs/heads/test'
with:
url: ${{ secrets.WEBHOOK_URL_AUT_WORKS_TEST_FROM_TEST }}
body: '{}'
- name: Test bib webhook
uses: joelwmale/webhook-action@master
if: github.ref == 'refs/heads/test'
with:
url: ${{ secrets.WEBHOOK_URL_BIB_TEST_FROM_TEST }}
body: '{}'