Skip to content

Commit

Permalink
chore: Merge jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
xhad committed Feb 21, 2024
1 parent 88315ac commit 2aa3a78
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 126 deletions.
108 changes: 108 additions & 0 deletions .github/workflows/Jobs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: Tests

on:
workflow_dispatch:
pull_request:
push:
branches:
- main

jobs:
format:
name: Prettier
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 20.x

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Run Prettier
run: yarn format:check

lint:
name: ESLint
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 20.x

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Run ESLint
run: yarn lint

test:
name: Matchstick
runs-on: ubuntu-latest
container: node:18

services:
postgres:
image: postgres:14
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 20.x

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Run codegen
run: yarn codegen

- name: Run build
run: yarn build:local

- name: Run tests
run: yarn test
40 changes: 0 additions & 40 deletions .github/workflows/format.yml

This file was deleted.

40 changes: 0 additions & 40 deletions .github/workflows/lint.yml

This file was deleted.

46 changes: 0 additions & 46 deletions .github/workflows/tests.yml

This file was deleted.

0 comments on commit 2aa3a78

Please sign in to comment.