-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (77 loc) · 2.97 KB
/
booking.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
name: Booking Action
env:
ED_USERNAME: ${{ secrets.ED_USERNAME }}
ED_PASSWORD: ${{ secrets.ED_PASSWORD }}
CAPTCHA_API_KEY: ${{ secrets.CAPTCHA_API_KEY }}
SIGN_IN_URL: ${{ vars.SIGN_IN_URL }}
EXEC_MINS: ${{ vars.EXEC_MINS }}
# Controls when the workflow will run
on:
pull_request:
types:
- opened
- synchronize
- reopened
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Triggers the workflow through a webhook event
repository_dispatch:
types: [booking]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
define-env:
runs-on: ubuntu-latest
environment:
name: ${{ github.event.client_payload.environment || 'test' }}
outputs:
PERSONS: ${{ steps.compute-outputs.outputs.PERSONS }}
BOOKING_URL: ${{ steps.compute-outputs.outputs.BOOKING_URL }}
DUMMY_BOOKING_URL: ${{ steps.compute-outputs.outputs.DUMMY_BOOKING_URL }}
steps:
- id: compute-outputs
name: Compute Outputs
run: |
echo "PERSONS=${{ toJson(vars.PERSONS) }}" >> "$GITHUB_OUTPUT"
echo "BOOKING_URL=${{ vars.BOOKING_URL }}" >> "$GITHUB_OUTPUT"
echo "DUMMY_BOOKING_URL=${{ vars.DUMMY_BOOKING_URL }}" >> "$GITHUB_OUTPUT"
add-persons:
needs: define-env
env:
DUMMY_BOOKING_URL: ${{ needs.define-env.outputs.DUMMY_BOOKING_URL }}
BOOKING_URL: ${{ needs.define-env.outputs.BOOKING_URL }}
# The type of runner that the job will run on
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
person: ${{ fromJson(needs.define-env.outputs.PERSONS) }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- name: Setup project
uses: ./.github/actions/setup-project
with:
DECRYPTION_SECRET: ${{ secrets.DECRYPTION_SECRET }}
# Setup FFmpeg
- name: Setup FFmpeg
uses: FedericoCarboni/setup-ffmpeg@v3
# Runs Puppeteer
- name: Run Puppeteer
run: export PERSON="${{ matrix.person }}" && node add-to-cart.mjs
# Archive Debug Logs
- name: Archive Debug Logs
if: always()
continue-on-error: true
run: tar -czvf "debug-logs-${{ matrix.person }}.tar.gz" "screenshot-${{ matrix.person }}.png" "screenshot-final-${{ matrix.person }}.png" "trace-${{ matrix.person }}.json" "recording-${{ matrix.person }}.webm"
# Encrypt Debug Logs
- name: Encrypt Debug Logs
if: always()
run: gpg --batch -c --passphrase ${{ secrets.ARTIFACT_ENCRYPTION_PASS }} "debug-logs-${{ matrix.person }}.tar.gz"
# Uploads results
- name: Upload Screenshots
uses: actions/upload-artifact@v4
if: always()
with:
name: debug-logs-${{ matrix.person }}
path: debug-logs-${{ matrix.person }}.tar.gz.gpg