This repository has been archived by the owner on Jun 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
98 lines (82 loc) · 3.3 KB
/
test.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: Test
on:
pull_request:
branches: ["main"]
paths-ignore: ["docs/**"]
push:
branches: ["main"]
paths-ignore: ["docs/**"]
jobs:
test:
timeout-minutes: 60
runs-on: ${{ matrix.os }}
strategy:
matrix:
# Broken on ubuntu right now
# os: [macos-latest, windows-latest, ubuntu-latest]
os: [macos-latest, windows-latest]
steps:
- name: Checkout code w/ cache
uses: nschloe/action-cached-lfs-checkout@v1
- name: Checkout LFS objects
run: git lfs checkout
- name: Install Node and NPM
uses: actions/setup-node@v3
with:
node-version: 16
cache: npm
- name: Setup NPM auth token for font awesome pro & github packages
shell: bash
run: >
echo "//npm.fontawesome.com/:_authToken=${{ secrets.FONT_AWESOME_TOKEN }}" >> ~/.npmrc &&
echo "//npm.pkg.github.com/:_authToken=${{ secrets.READ_PACKAGES_TOKEN }}" >> ~/.npmrc
- name: Install dependencies
run: cat ~/.npmrc && npm ci --verbose
- name: Setup dotenv files
shell: bash
run: >
echo $GITHUB_TAG_VERSION &&
if [[ $GITHUB_TAG_VERSION == *"beta"* || $GITHUB_TAG_VERSION == *"alpha"* ]]; then
echo "PLATFORM_URL=${{ secrets.BETA_PLATFORM_URL }}" >> .env && echo "SERIOUS_PROTECTION=${{ secrets.BETA_SERIOUS_PROTECTION }}" >> .env;
else echo "PLATFORM_URL=${{ secrets.PLATFORM_URL }}" >> .env && echo "SERIOUS_PROTECTION=${{ secrets.SERIOUS_PROTECTION }}" >> .env; fi &&
echo "TRACK_EVENTS=${{ secrets.TRACK_EVENTS }}" >> .env &&
if [[ $GITHUB_TAG_VERSION == *"alpha"* ]]; then echo "UPDATE_FEED_URL=${{ secrets.INTERNAL_UPDATE_FEED_URL }}" >> .env; else echo "UPDATE_FEED_URL=${{ secrets.UPDATE_FEED_URL }}" >> .env; fi &&
if [[ $GITHUB_TAG_VERSION == *"beta"* || $GITHUB_TAG_VERSION == *"alpha"* ]]; then echo "SENTRY_DSN=${{ secrets.SENTRY_DSN }}" >> .env; else echo "SENTRY_DSN=" >> .env; fi
- name: Install Playwright
run: npx playwright install
- name: Build package
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm run build:playwright
- name: Run TikTok tests w/ timeout and retries
uses: nick-fields/retry@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DUMP_PATH: "./tests/data/tiktok-dump-01.json"
EXPORT_PATH: "test-runs"
with:
timeout_minutes: 10
max_attempts: 3
command: npm test -- start.test.ts tiktok-import.test.ts
- name: Run Google Takeout Youtube tests w/ timeout and retries
uses: nick-fields/retry@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DUMP_PATH: "./tests/data/google-takeout-youtube-watch-history-01.json"
EXPORT_PATH: "test-runs"
with:
timeout_minutes: 10
max_attempts: 3
command: npm test -- google-takeout-youtube-import.test.ts
- name: Archive npm logs
uses: actions/upload-artifact@v2
if: failure()
with:
name: npm-logs-test
path: ~/.npm/_logs
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30