-
Notifications
You must be signed in to change notification settings - Fork 5
75 lines (73 loc) · 3.19 KB
/
test-node-cache.yml
File metadata and controls
75 lines (73 loc) · 3.19 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
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
name: test-node-cache
on: [push]
jobs:
test-node-cache:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- "5432:5432"
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 14
- name: Optionally install Chromium via APT instead of puppeteer
run: |
if [ ! -z "$PUPPETEER_SKIP_CHROMIUM_DOWNLOAD" ]; then
APT_INSTALL="chromium gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget"
if [ ! -z "$APT_PROXY" ]; then
echo "deb $APT_PROXY buster main" > /etc/apt/sources.list
fi
apt-get update
apt-get install -y $APT_INSTALL
fi
- name: Set up project
run: |
HERE=`pwd`
mkdir /tmp/project
cd /tmp/project
if [ -d /opt/hostedtoolcache/node/ ]; then
alias node=`find /opt/hostedtoolcache/node/ -maxdepth 4 -name node`
alias npm=`find /opt/hostedtoolcache/node/ -maxdepth 4 -name npm`
fi
FORWARDER=""
if [ ! -z "$NGROK" ]; then
FORWARDER="ngrok"
elif [ ! -z "$PUBLIC_IP" ]; then
FORWARDER="public-ip"
elif [ ! -z "$LOCALTUNNEL" ]; then
FORWARDER="localtunnel"
fi
npm init -y
npm install "$HERE" @userdashboard/dashboard @userdashboard/maxmind-geoip faker puppeteer mocha $FORWARDER
PACKAGE=`cat package.json`
PACKAGE=${PACKAGE/\"description\"\: \"\"/\"dashboard\": \{ \"modules\"\: \[\"@userdashboard/stripe-subscriptions\"\] \}}
echo $PACKAGE > package.json
echo "global.applicationPath = __dirname" > main.js
echo "require('@userdashboard/stripe-subscriptions/test-helper.js')" >> main.js
- name: Test NodeJS caching with encrypted data
run: ./node_modules/.bin/mocha --file main.js --bail --exit --recursive --timeout 90000000 $(find ./node_modules/@userdashboard/*/ -name "*.test.js" | grep -i -v [a-z0-9]/node_modules | sort -k5.1,8.1 -t /)
working-directory: /tmp/project
env:
NODE_ENV: testing
STORAGE: "@userdashboard/storage-postgresql"
DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres
CACHE: node
STRIPE_KEY: ${{ secrets.STRIPE_KEY_5 }}
STRIPE_PUBLISHABLE_KEY: ${{ secrets.STRIPE_PUBLISHABLE_KEY_5 }}
STRIPE_JS: false
SUBSCRIPTION_WEBHOOK_ENDPOINT_SECRET: replaced-at-runtime
NGROK: true
ENCRYPTION_SECRET: abc45678901234567890123456789012
ENCRYPTION_SECRET_IV: abc4123412341234
DISABLE_PAYOUT_TESTS: true
NODE_OPTIONS: --preserve-symlinks