-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (50 loc) · 1.55 KB
/
lint-and-test-server.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
name: Lint and Test - Server
on:
pull_request:
branches: [ master ]
paths:
- 'server/**'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
lint-and-test-server:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Create .env file from example
run: cp example.env .env
- name: Create secret file from example
run: cp secret.example.ts secret.ts
working-directory: server
- uses: actions/setup-node@v2
with:
node-version: '16'
- name: Install server dependencies
run: npm install
working-directory: server
- name: Run ESLint - Server
run: ./node_modules/.bin/eslint ./
working-directory: server
- name: Compile Typescript - Server
run: ./node_modules/.bin/tsc
working-directory: server
- name: Build from Docker-Compose
run: docker-compose -f docker-compose.yml -f development.yml build
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
- name: Launch containers
run: docker-compose -f docker-compose.yml -f development.yml up -d
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
- name: Pull env vars from file
run: source ./.env
- name: Docker ps
run: docker ps
- name: Sleep for 5 seconds
run: sleep 5s
shell: bash
- name: Docker logs
run: docker-compose logs
- name: Run tests
run: WEEK=14 npm run test
working-directory: server