forked from SMTP2Graph/SMTP2Graph
-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (71 loc) · 2.45 KB
/
test-binary.yml
File metadata and controls
83 lines (71 loc) · 2.45 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Basic tests - binary
on:
workflow_call:
inputs:
platform:
description: Which platform are we going to test
type: string
required: true
binaryName:
description: Name of the binary (located in dist folder)
type: string
required: true
useArch:
description: Run on different architecture
type: string
workflow_dispatch:
inputs:
platform:
description: Which platform are we going to test
type: choice
required: true
options:
- windows-latest
- ubuntu-latest
binaryName:
description: Name of the binary (located in dist folder)
type: string
required: true
jobs:
test:
runs-on: ${{ inputs.platform }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Install dependencies
run: npm ci
- name: Download builds
uses: actions/download-artifact@v4
with:
name: builds
path: dist
- name: Set executable permission on binary (on Linux)
if: runner.os == 'Linux'
run: chmod +x ./dist/${{ inputs.binaryName }}
- name: Set up QEMU
if: ${{ inputs.useArch }}
uses: docker/setup-qemu-action@v3
- name: Run standard test on ${{ inputs.useArch || '(skipped)' }}
if: ${{ inputs.useArch }}
run: docker run --rm --platform linux/${{ inputs.useArch }} -v $PWD:/usr/src/app -w /usr/src/app node:20 npm run test:receive -- --serverFile=dist/${{ inputs.binaryName }} --reporter json --reporter-option output=test-results.json
- name: Run standard tests
if: ${{ ! inputs.useArch }}
run: npm run test:receive -- --serverFile=dist/${{ inputs.binaryName }} --reporter json --reporter-option output=test-results.json
- name: Test report
uses: phoenix-actions/test-reporting@v12
if: success() || failure()
with:
name: Test result ${{ inputs.binaryName }}
path: test-results.json
reporter: mocha-json
- name: Upload logs
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: logs_${{ inputs.binaryName }}
path: logs/
if-no-files-found: ignore