-
Notifications
You must be signed in to change notification settings - Fork 0
127 lines (124 loc) · 3.38 KB
/
Copy pathtest.yaml
File metadata and controls
127 lines (124 loc) · 3.38 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
name: Test, Lint, and Build
on:
workflow_call:
inputs:
runs-on:
description: The runner on which to run this script
required: true
type: string
create-artifact:
description: True to allow the workflow to create a build artifact
required: false
default: false
type: boolean
test-release:
description: True to ensure that release testing is performed
required: false
default: false
type: boolean
secrets:
personal_access_token:
required: false
jobs:
setup_frontend:
name: Setup Frontend
runs-on: ${{ inputs.runs-on }}
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
- run: npm ci
- uses: actions/cache@v5
with:
path: node_modules
key: ${{ inputs.runs-on }}-node_modules
lint_frontend:
name: Lint Frontend
needs: setup_frontend
runs-on: ${{ inputs.runs-on }}
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
- run: npm ci
- run: npm run lint
test_frontend:
name: Test Frontend
needs: setup_frontend
runs-on: ${{ inputs.runs-on }}
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
- run: npm ci
- run: npx playwright install
- run: npm run test-storybook
build_frontend:
name: Build Frontend
needs: setup_frontend
runs-on: ${{ inputs.runs-on }}
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
- run: npm ci
- run: npm run build
- uses: actions/cache@v5
with:
path: www
key: ${{ inputs.runs-on }}-www
lint_backend:
name: Lint Backend
runs-on: ${{ inputs.runs-on }}
steps:
- uses: actions/checkout@v6
- uses: astral-sh/setup-uv@v7
with:
activate-environment: true
enable-cache: true
- run: uv sync
- run: ruff check
- run: ty check
test_backend:
name: Test Backend
needs: build_frontend
runs-on: ${{ inputs.runs-on }}
steps:
- uses: actions/checkout@v6
- uses: astral-sh/setup-uv@v7
with:
activate-environment: true
enable-cache: true
- run: uv sync
- uses: actions/cache@v5
with:
path: www
key: ${{ inputs.runs-on }}-www
fail-on-cache-miss: true
- run: pytest backend/tests --tag-name ${{ github.ref_name }}
if: ${{ inputs.test-release }}
- run: pytest
if: ${{ !inputs.test-release }}
build_backend:
name: Build backend
needs: build_frontend
runs-on: ${{ inputs.runs-on }}
steps:
- uses: actions/checkout@v6
- uses: astral-sh/setup-uv@v7
with:
activate-environment: true
enable-cache: true
- run: uv sync
- uses: actions/cache@v5
with:
path: www
key: ${{ inputs.runs-on }}-www
fail-on-cache-miss: true
- uses: actions/setup-python@v6
with:
python-version-file: pyproject.toml
- run: pyinstaller backend/build.spec
- run: rm -rf "dist/NSO Bridge"; chmod -R +x "dist/NSO Bridge.app"
if: ${{ runner.os == 'macOS' }}
- uses: actions/upload-artifact@v4
if: ${{ inputs.create-artifact }}
with:
name: nsobridge-${{inputs.runs-on }}
path: dist