-
-
Notifications
You must be signed in to change notification settings - Fork 11
118 lines (100 loc) · 3.51 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: CI Test
on:
- pull_request
- workflow_call
jobs:
test:
name: Perform Tests
runs-on: ubuntu-latest
# runs all of the steps inside the specified container rather than on the VM host.
# Because of this the network configuration changes from host based network to a container network.
# container:
# image: node:10.16-jessie
# Set PostgreSQL database
services:
mongodb:
image: mongo
env:
MONGO_INITDB_ROOT_USERNAME: sebedius
MONGO_INITDB_ROOT_PASSWORD: tomasharenstam1234
MONGO_INITDB_DATABASE: eden
ports:
# - 27017:27017
# Will assign a random free host port
- 27017/tcp
# postgres:
# image: postgres:latest
# env:
# POSTGRES_DB: eden
# POSTGRES_USER: sebedius
# POSTGRES_PASSWORD: tomasharenstam1234
# # POSTGRES_PORT: 5432
# ports:
# - 5432:5432
# Set health checks to wait until mongo has started
# options: >-
# --health-cmd mongo
# --health-interval 10s
# --health-timeout 5s
# --health-retries 5
steps:
- name: 📡 Checkout
uses: actions/checkout@v3
- name: ⚙️ Setup NodeJS 16
uses: actions/setup-node@v3
with:
node-version: 16
- name: 🔧 Install Dependencies
run: npm ci
# - name: ✒️ Check Lint
# run: npm run lint
- name: 🎲 Test Rolls
run: npm run test:roll
- name: 📑 Test Tables
run: npm run test:table
- name: 🤖 Test Bot
run: npm run test:client
env:
BETA_DISCORD_TOKEN: ${{ secrets.BETA_DISCORD_TOKEN }}
BETA_BOT_ID: ${{ secrets.BETA_BOT_ID }}
OWNER_ID: ${{ secrets.OWNER_ID }}
- name: 🏷️ Test Translations
run: npm run test:locale
if: false
- name: 🏷️ Test Translations
run: npm run test:locale
if: true
env:
NODE_ENV: production
- name: 🍃 Test MongoDB Database
run: npm run test:db
env:
# use localhost for the host here because we are running the job on the VM.
# If we were running the job on in a container this would be mongodb
MONGODB_HOST: localhost
MONGODB_PORT: ${{ job.services.mongodb.ports[27017] }}
DATABASE_URI: 'mongodb://sebedius:tomasharenstam1234@localhost/eden'
# vm-job:
# runs-on: ubuntu-latest
# services:
# mongodb:
# image: mongo
# env:
# MONGO_INITDB_ROOT_USERNAME: sebedius
# MONGO_INITDB_ROOT_PASSWORD: tomasharenstam1234
# MONGO_INITDB_DATABASE: eden
# ports:
# # will assign a random free host port
# - 27017/tcp
# steps:
# - uses: actions/checkout@v3
# - run: npm ci
# - run: npm run test:db
# env:
# # use localhost for the host here because we are running the job on the VM.
# # If we were running the job on in a container this would be mongodb
# MONGODB_HOST: localhost
# MONGODB_PORT: ${{ job.services.mongodb.ports[27017] }} # get randomly assigned published port
# DATABASE_URI: 'mongodb+srv://sebedius:tomasharenstam1234@localhost:27017/eden'