This repository was archived by the owner on Mar 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27
63 lines (61 loc) · 2.4 KB
/
node-pr-jobs-secure.yml
File metadata and controls
63 lines (61 loc) · 2.4 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
58
59
60
61
62
63
# Copyright Strimzi authors.
# License: Apache License 2.0 (see the file LICENSE or http://apache.org/licenses/LICENSE-2.0.html).
name: Node
# Running target makes it secure as this is the only way to get hold of github secrets
on: [pull_request_target]
jobs:
build-current:
runs-on: ubuntu-20.04
name: Build and Test
steps:
- name: Checkout master
uses: actions/checkout@v2
with:
ref: master
- name: Install Dependencies
run: npm ci
- name: Build
run: npm run build
- name: Upload Master Bundle Report for client and server
run: |
echo "CLIENT_MASTER_REPORT=$(cat generated/bundle-analyser/client-report.json)" >> $GITHUB_ENV
echo "SERVER_MASTER_REPORT=$(cat generated/bundle-analyser/server-report.json)" >> $GITHUB_ENV
- name: Checkout PR Branch
uses: actions/checkout@v2
with:
repository: ${{github.event.pull_request.head.repo.full_name}}
ref: ${{github.event.pull_request.head.ref}}
fetch-depth: 0
- name: Use Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Install Dependencies and setup for CI
run: |
npm ci
npm run addDevCerts
- name: Build
run: npm run build
- name: Calculate bundle size
id: bundle
uses: ./.github/actions/bundle
with:
CLIENT_MASTER_REPORT: ${{ env.CLIENT_MASTER_REPORT }}
SERVER_MASTER_REPORT: ${{ env.SERVER_MASTER_REPORT }}
- name: Test client code
run: npm run test:jest:client -- --forceExit # force exit in case a test does not clean up after failure
- name: Test server code
if: ${{ success() || failure() }}
run: npm run test:jest:server -- --forceExit # force exit in case a test does not clean up after failure
- name: Coverage report
id: coverage
if: ${{ success() || failure() }}
uses: ./.github/actions/coverage-report
- name: Comment on PR
if: ${{ success() || failure() }}
uses: ./.github/actions/commenter
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BUNDLE_REPORT: ${{ steps.bundle.outputs.bundle_report }}
TEST_COVERAGE_CLIENT: ${{ steps.coverage.outputs.test_coverage_client }}
TEST_COVERAGE_SERVER: ${{ steps.coverage.outputs.test_coverage_server }}