-
Notifications
You must be signed in to change notification settings - Fork 11
62 lines (61 loc) · 2.13 KB
/
integration.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
name: Integration testing
on:
push:
branches: [ main, dev** ]
tags:
- "*"
pull_request:
env:
COV_NODE_VERSION: 20
UPSTREAM_TAR: quipucords-ui-dist.tar
jobs:
Integration:
runs-on: ubuntu-latest
permissions:
# required for releasing artifacts
contents: write
strategy:
matrix:
node-version: [18.x, 20.x]
steps:
- uses: actions/checkout@v4
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
- name: Node.js modules cache
uses: actions/cache@v4
id: modules-cache
with:
path: ${{ github.workspace }}/node_modules
key: ${{ runner.os }}-${{ matrix.node-version }}-modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-${{ matrix.node-version }}-modules
- name: Install Node.js packages
if: ${{ steps.modules-cache.outputs.cache-hit != 'true' }}
run: npm install
- name: Linting
run: npm run test:ci-lint
- name: Build integration
run: npm run test:ci-build
- name: Unit tests
run: npm run test:ci-coverage
- name: Compress upstream assets
if: ${{ success() && startsWith(matrix.node-version, env.COV_NODE_VERSION) && startsWith(github.ref, 'refs/tags/') }}
run: |
tar -cf ${UPSTREAM_TAR} build
gzip -f --best ${UPSTREAM_TAR}
- name: Release artifacts
uses: ncipollo/[email protected]
if: ${{ success() && startsWith(matrix.node-version, env.COV_NODE_VERSION) && startsWith(github.ref, 'refs/tags/') }}
with:
artifacts: "${{ env.UPSTREAM_TAR }}.gz"
# set allow updates so we can create releases to trigger this
allowUpdates: true
# don't override what's set on the release
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
omitPrereleaseDuringUpdate: true
# required for publishing artifacts and updating the release
token: ${{ secrets.GITHUB_TOKEN }}