-
Notifications
You must be signed in to change notification settings - Fork 2
98 lines (80 loc) · 2.59 KB
/
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
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
name: 'E2E Tests'
on:
push:
branches: [v3.x-bundle]
paths-ignore:
- '**/*.md'
# pull_request:
# branches: [ main ]
# paths-ignore:
# - '**/*.md'
env:
pnpm_version: 8
node_version: 20
debug_identifier: nammatham:*
RESOURCE_IDENTIFIER_NODE18_LINUX_X64: ${{ secrets.RESOURCE_IDENTIFIER_NODE18_LINUX_X64 }}
jobs:
get-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.deploy-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
- name: Use Node.js ${{ env.node_version }}
uses: actions/setup-node@v4
with:
node-version: ${{env.node_version }}
- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: ${{ env.pnpm_version }}
- run: pnpm install
- name: Export the matrix for testing
id: deploy-matrix
run: pnpm exec nx run @infra/azure-functions:github-actions
build:
runs-on: ${{ matrix.os }}
needs: get-matrix
strategy:
matrix:
include: ${{fromJson(needs.get-matrix.outputs.matrix)}}
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
if: matrix.runtime == 'bun'
- name: Use Node.js ${{ matrix.version }}
if: matrix.runtime == 'node'
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.version }}
- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: ${{ env.pnpm_version }}
- run: pnpm install
- run: pnpm build
- name: pnpm install again for ensure the cli is available
run: pnpm install
- name: Build the project
run: pnpm exec nx run @examples/with-${{ matrix.runtime }}:build
env:
DEBUG: ${{ env.debug_identifier }}
- name: Azure Login
uses: azure/login@v2
with:
creds: ${{ secrets.AZURE_CREDENTIALS_E2E_TESTS }}
- name: Azure CLI script
uses: azure/cli@v2
with:
azcliversion: 2.58.0
inlineScript: |
cd examples/with-${{ matrix.runtime }}/.nmt/dist && \
func azure functionapp publish nmt-e2e-${{ matrix.target }}-${{ matrix.resource_identifier }}
- name: Wait for the deployment to finish
run: sleep 60
- name: Run E2E tests
run: pnpm exec nx run @infra/azure-functions:test
env:
AZURE_FUNCTIONS_URL: https://nmt-e2e-${{ matrix.target }}-${{ matrix.resource_identifier }}.azurewebsites.net
AZURE_FUNCTIONS_API_KEY: ${{ secrets.AZURE_FUNCTIONS_HOST_KEY }}