-
Notifications
You must be signed in to change notification settings - Fork 3.9k
56 lines (49 loc) · 1.64 KB
/
reusable-ws-e2e.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
name: E2E WebSocket Tests
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
# Controls when the action will run. Triggers the workflow on push or pull request
on:
workflow_call:
inputs:
ee:
description: 'use the ee version of worker'
required: false
default: false
type: boolean
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
e2e_ws:
# The type of runner that the job will run on
runs-on: ubuntu-latest
timeout-minutes: 80
permissions:
contents: read
packages: write
deployments: write
id-token: write
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- id: setup
run: |
if ! [[ -z "${{ secrets.SUBMODULES_TOKEN }}" ]]; then
echo "has_token=true" >> $GITHUB_OUTPUT
else
echo "has_token=false" >> $GITHUB_OUTPUT
fi
# checkout with submodules if token is provided
- uses: actions/checkout@v4
if: steps.setup.outputs.has_token == 'true'
with:
submodules: ${{ inputs.ee }}
token: ${{ secrets.SUBMODULES_TOKEN }}
# else checkout without submodules if the token is not provided
- uses: actions/checkout@v4
if: steps.setup.outputs.has_token != 'true'
- uses: ./.github/actions/setup-project
# Runs a single command using the runners shell
- name: Build WS
run: CI='' pnpm build:ws
- name: Run unit tests
run: |
cd apps/ws && pnpm test