-
Notifications
You must be signed in to change notification settings - Fork 8
36 lines (30 loc) · 1.05 KB
/
e2e.yml
File metadata and controls
36 lines (30 loc) · 1.05 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
# Optional live API checks. Add repository secret HACKMD_E2E_ACCESS_TOKEN.
# Optionally add HACKMD_E2E_API_ENDPOINT (e.g. https://api-stage.hackmd.io/v1); otherwise production is used.
name: E2E (live HackMD API)
on:
workflow_dispatch:
jobs:
e2e:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: nodejs/package-lock.json
- name: Install dependencies
working-directory: nodejs
run: npm ci
- name: Run e2e tests
working-directory: nodejs
env:
HACKMD_ACCESS_TOKEN: ${{ secrets.HACKMD_E2E_ACCESS_TOKEN }}
HACKMD_API_ENDPOINT: ${{ secrets.HACKMD_E2E_API_ENDPOINT }}
run: |
if [ -z "${HACKMD_ACCESS_TOKEN:-}" ]; then
echo "::error::Add repository secret HACKMD_E2E_ACCESS_TOKEN (a valid API token for the target environment)."
exit 1
fi
npm run test:e2e