-
Notifications
You must be signed in to change notification settings - Fork 1
86 lines (72 loc) · 2.35 KB
/
build.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
name: Build and Test
on:
push:
workflow_dispatch:
env:
# WIREIT_LOGGER: "metrics"
FORCE_COLOR: "true"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
checks: write
statuses: write
pull-requests: write
steps:
- uses: actions/checkout@main
- uses: actions/setup-node@main
with:
node-version: "19"
- uses: google/wireit@setup-github-actions-caching/v1
- run: npm install
- run: npm run build
- run: npm run generate:spec
- run: ls -la
- run: ls -la generated
- run: if [ ! -f generated/openapi.json ]; then exit 1; fi
- run: if [ ! -f generated/openapi.dereferenced.json ]; then exit 1; fi
- run: if [ ! -f generated/openapi.3.0.json ]; then exit 1; fi
- run: if [ ! -f generated/openapi.dereferenced.3.0.json ]; then exit 1; fi
- run: npm run test:report
continue-on-error: true
- name: Process jest results with default
if: always()
uses: im-open/process-jest-test-results@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
results-file: jest.report.json
timezone: "europe/london"
- uses: actions/upload-artifact@main
with:
name: jest-report
path: ./jest.report.json
- name: Upload OpenAPI 3.1 spec
uses: actions/upload-artifact@main
with:
name: openapi.3.1
path: generated/openapi.json
- name: Upload Dereferenced OpenAPI 3.1 spec
uses: actions/upload-artifact@main
with:
name: openapi.3.1.dereferenced
path: generated/openapi.dereferenced.json
- name: Upload OpenAPI 3.0 spec
uses: actions/upload-artifact@main
with:
name: openapi.3.0
path: generated/openapi.3.0.json
- name: Upload Dereferenced OpenAPI 3.0 spec
uses: actions/upload-artifact@main
with:
name: openapi.dereferenced.3.0
path: generated/openapi.dereferenced.3.0.json
- name: Fail if there were errors in the jest tests
if: steps.process-jest.outputs.test-outcome == 'Failed'
run: |
echo ${{ steps.process-jest.outputs.test-outcome }}
exit 1