mirror of
https://github.com/psforever/PSF-LoginServer.git
synced 2026-01-19 18:44:45 +00:00
44 lines
1.2 KiB
YAML
44 lines
1.2 KiB
YAML
name: Test
|
|
on: [push, pull_request]
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
services:
|
|
postgres:
|
|
image: postgres
|
|
env:
|
|
POSTGRES_DB: psforever
|
|
POSTGRES_USER: psforever
|
|
POSTGRES_PASSWORD: psforever
|
|
options: >-
|
|
--health-cmd pg_isready
|
|
--health-interval 10s
|
|
--health-timeout 5s
|
|
--health-retries 5
|
|
ports:
|
|
- 5432:5432
|
|
steps:
|
|
- name: Cache SBT
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: |
|
|
~/.ivy2/cache
|
|
~/.sbt
|
|
key: ${{ runner.os }}-sbt-${{ hashFiles('**/build.sbt') }}
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
- name: Setup Scala
|
|
uses: olafurpg/setup-scala@v12
|
|
- name: Run migrations
|
|
run: sbt "server/run migrate"
|
|
- name: Run build
|
|
run: sbt server/packArchiveZip
|
|
- name: Run tests
|
|
run: sbt coverage test:compile quiet:test coverageReport
|
|
- name: Upload coverage
|
|
run: bash <(curl -s https://codecov.io/bash)
|
|
- name: Upload artifacts
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: server.zip
|
|
path: server/target/psforever-server-*.zip |