ci: add build/test jobs

pull/4/head
Cameron Clough 2022-03-26 22:54:28 +00:00
parent 923b25697c
commit 18a37f971e
No known key found for this signature in database
GPG Key ID: BFB3B74B026ED43F
1 changed files with 28 additions and 16 deletions

View File

@ -3,6 +3,34 @@ name: Build and test
on: [push, pull_request]
jobs:
test:
name: Run tests
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16'
- name: Install dependencies
run: npm ci
- name: Run linter
run: npm run lint
- name: Run tests
run: npm test
build:
name: Build
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16'
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
docker:
name: Build Docker image
runs-on: ubuntu-20.04
@ -34,19 +62,3 @@ jobs:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
# lint:
# name: Run linter
# runs-on: ubuntu-20.04
# needs: docker
# steps:
# - name: Run linter
# run: docker run --rm retropilot-server:latest npm run lint
# test:
# name: Run tests
# runs-on: ubuntu-20.04
# needs: docker
# steps:
# - name: Run tests
# run: docker run --rm --env-file .env.sample -v /tmp/realdata:/app/realdata retropilot-server:latest npm test