Skip to content

Merge pull request #292 from willroberts/update-docs #289

Merge pull request #292 from willroberts/update-docs

Merge pull request #292 from willroberts/update-docs #289

name: integration_tests
on:
push:
branches:
- main
pull_request:
paths:
- app/**
- config/**
- gulp/**
- gulpfile.babel.js
- package.json
- server/**
- test/**
- worker/**
- yarn.lock
jobs:
integration_tests:
runs-on: ubuntu-latest
container: node:18-slim
services:
redis:
image: redis:6
db:
image: postgres:13
env:
POSTGRES_USER: duelyst
POSTGRES_PASSWORD: duelyst
POSTGRES_DB: duelyst
steps:
- name: install bcrypt dependencies and git
run: apt-get update && apt-get -y install python3 make gcc g++ git
- name: check out code
uses: actions/checkout@v3
# Caching node_modules saves 50s on builds which don't modify dependencies.
# Compared to yarn caching, it saves an additional 27 seconds.
- name: cache node_modules
uses: actions/cache@v3
with:
path: /home/runner/work/duelyst/duelyst/node_modules
key: node-modules-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
node-modules-
- name: redirect git ssh to https
run: |
git config --global url."https://github.com/".insteadOf git@github.com:
git config --global url."https://".insteadOf git://
- name: install node dependencies
run: yarn install --dev
- name: run database migrations
run: yarn migrate:latest
env:
NODE_ENV: development
POSTGRES_CONNECTION: "pg://duelyst:duelyst@db/duelyst"
- name: run integration tests
run: yarn test:integration:misc
env:
REDIS_HOST: redis
POSTGRES_CONNECTION: "pg://duelyst:duelyst@db/duelyst"
# TODO: Create a Firebase Realtime Database for CI.
FIREBASE_URL: "https://test-url.firebaseio.com/"