-
Notifications
You must be signed in to change notification settings - Fork 74
73 lines (60 loc) · 2.35 KB
/
test.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
name: Tests
on:
pull_request:
branches: [main, release/**]
push:
branches: [main, release/**]
tags: [v*]
concurrency:
group: pr-checks-${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
test-node:
name: Tests
runs-on: smart-contracts-linux-medium
steps:
- name: Harden Runner
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
with:
egress-policy: audit
- name: Install build tools
run: sudo apt-get update && sudo apt-get install -y make gcc g++
- name: Use Node.js TLS 18
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: 20
- name: Checkout repository
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- name: Install dependencies
run: npm ci
- name: Create .env file
run: cp ./packages/relay/tests/test.env .env
- name: Install pnpm
run: npm install -g pnpm
- name: Build Typescript and Run tests
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_PR_NUMBER: ${{ github.event.number }}
GITHUB_REPOSITORY: ${{ github.repository }}
run: npm run build-and-test
- name: Upload Heap Snapshots
if: ${{ !cancelled() }}
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name: Heap Snapshots
path: "**/*.heapsnapshot"
if-no-files-found: ignore
- name: Upload coverage report
if: ${{ !cancelled() && always() }}
run: bash .github/scripts/codecov-upload.sh
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Publish Test Report
if: ${{ github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name && github.actor != 'dependabot[bot]' && github.actor != 'swirlds-automation' && !cancelled() && !failure() }}
uses: step-security/publish-unit-test-result-action@4519d7c9f71dd765f8bbb98626268780f23bab28 # v2.17.0
with:
# check_name: Tests
check_name: '' # Set to empty to disable check run
json_thousands_separator: ','
files: 'test-*.xml'
github_token: ${{ secrets.GITHUB_TOKEN }}