-
Notifications
You must be signed in to change notification settings - Fork 11
70 lines (61 loc) · 2.08 KB
/
Copy pathui-alp-portal-test-fe.yml
File metadata and controls
70 lines (61 loc) · 2.08 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
name: d2e-ui/portal tests
permissions:
contents: read
on:
pull_request:
types: [opened, ready_for_review, reopened, synchronize]
merge_group:
push:
branches:
- develop
jobs:
pick_runner:
runs-on: ubuntu-latest
outputs:
random_runner: ${{ steps.shuffle.outputs.random_runner }}
steps:
- id: shuffle
run: echo "random_runner=$(shuf -e ubuntu-22.04 ubuntu-24.04 | head -n 1)" >> "$GITHUB_OUTPUT"
test-alp-portal-frontend:
needs: [pick_runner]
runs-on: ${{ needs.pick_runner.outputs.random_runner }}
defaults:
run:
working-directory: ./plugins/ui
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: true
# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: dorny/paths-filter@v3
id: check_file_changed
with:
filters: |
portal_fe_changed:
- './plugins/ui/apps/portal/**'
- '.github/workflows/ui-alp-portal-test-fe.yml'
- name: Setup bun if files have changed
uses: oven-sh/setup-bun@v2
if: github.ref_name == 'develop' || github.event_name == 'merge_group' || steps.check_file_changed.outputs.portal_fe_changed == 'true'
with:
bun-version: 1.2.23
# Run the step only with "portal_fe_changed" equals "True"
- name: Run unit tests if files have changed
if: github.ref_name == 'develop' || github.event_name == 'merge_group' || steps.check_file_changed.outputs.portal_fe_changed == 'true'
run: |
bun install
bunx nx run @portal/components:build
bunx nx run portal:test