Skip to content

Commit

Permalink
Combine linting and testing
Browse files Browse the repository at this point in the history
  • Loading branch information
cbolles committed Aug 28, 2023
1 parent 7b9dece commit 11f5b72
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 61 deletions.
39 changes: 6 additions & 33 deletions .github/workflows/client.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,9 @@ on:
- main

jobs:
lint:
lint-test:
runs-on: ubuntu-latest
name: Check for Linting Errors
defaults:
run:
working-directory: client
name: Check for Linting Errors and Unit Test Errors
steps:
- name: Checkout Repository
uses: actions/checkout@v3
Expand All @@ -33,44 +30,20 @@ jobs:
node-version: 18

- name: NPM Install
run: npm install --only-dev
run: npm install --force
shell: bash

- name: Build GraphQL Code
run: npm run introspection

- name: Check for Linting Issues
run: npm run lint
run: npm run lint --workspace=client

- name: Check for Prettier Issues
run: npm run prettier

unit-tests:
runs-on: ubunut-latest
name: Unit Tests
defaults:
run:
working-directory: client
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}

- name: Setup NodeJS
uses: actions/setup-node@v3
with:
node-version: 18

- name: NPM Install
run: npm install --only-dev
shell: bash

- name: Build GraphQL Code
run: npm run introspection
run: npm run prettier --workspace=client

- name: Run unit tests for the client
run: npm run test
run: npm run test --workspace=client

docker-build:
runs-on: ubuntu-latest
Expand Down
32 changes: 4 additions & 28 deletions .github/workflows/server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ jobs:
lint:
runs-on: ubuntu-latest
name: Check for Linting Errors
defaults:
run:
working-directory: server
steps:
- name: Checkout Repository
uses: actions/checkout@v3
Expand All @@ -33,38 +30,17 @@ jobs:
node-version: 18

- name: NPM Install
run: npm install --only-dev
run: npm install
shell: bash

- name: Check for Linting Issues
run: npm run lint
run: npm run lint --workspace=server

- name: Check for Prettier Issues
run: npm run prettier

unit-tests:
runs-on: ubunut-latest
name: Unit Tests
defaults:
run:
working-directory: server
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}

- name: Setup NodeJS
uses: actions/setup-node@v3
with:
node-version: 18

- name: NPM Install
run: npm install --only-dev
shell: bash
run: npm run prettier --workspace=server

- name: Run unit tests
run: npm run test
run: npm run test --workspace=server

docker-build:
runs-on: ubuntu-latest
Expand Down

0 comments on commit 11f5b72

Please sign in to comment.