From 18a37f971e8e3ac1f668e10c17a4d5036c6ce1ce Mon Sep 17 00:00:00 2001 From: Cameron Clough Date: Sat, 26 Mar 2022 22:54:28 +0000 Subject: [PATCH] ci: add build/test jobs --- .github/workflows/ci.yml | 44 +++++++++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8a34d82..b665412 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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