Skip to content

Commit

Permalink
add github actions workflows to api directory
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasMeloSena committed Jul 13, 2024
1 parent 6db536e commit 28f1c2b
Show file tree
Hide file tree
Showing 12 changed files with 1,326 additions and 36 deletions.
46 changes: 42 additions & 4 deletions .github/workflows/linting.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: Linting
on: pull_request

jobs:
prettier:
name: Prettier
prettier_server:
name: Prettier Server
runs-on: ubuntu-latest

defaults:
Expand All @@ -22,8 +22,8 @@ jobs:

- run: npm run lint:prettier:check

eslint:
name: Eslint
eslint_server:
name: Eslint Server
runs-on: ubuntu-latest

defaults:
Expand All @@ -40,3 +40,41 @@ jobs:
- run: npm ci

- run: npm run lint:eslint:check

prettier_api:
name: Prettier Api
runs-on: ubuntu-latest

defaults:
run:
working-directory: ./api

steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 20

- run: npm ci

- run: npm run lint:prettier:check

eslint_api:
name: Eslint Api
runs-on: ubuntu-latest

defaults:
run:
working-directory: ./api

steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 20

- run: npm ci

- run: npm run lint:eslint:check
27 changes: 24 additions & 3 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: Automated Tests
on: pull_request

jobs:
jest:
name: Jest Ubuntu
jest_server:
name: Jest Server
runs-on: ubuntu-latest

env:
Expand All @@ -23,11 +23,32 @@ jobs:
EMAIL_PASSWORD: ${{ secrets.EMAIL_PASSWORD }}
TOKEN: ${{ secrets.TOKEN }}

defaults:
run:
working-directory: ./server

steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 20

- run: npm ci

- run: npm test

jest_api:
name: Jest Api
runs-on: ubuntu-latest

env:
DATABASE_URL: ${{ secrets.DATABASE_URL_API }}
TOKEN: ${{ secrets.TOKEN_API }}

defaults:
run:
working-directory: ./server
working-directory: ./api

steps:
- uses: actions/checkout@v4
Expand Down
5 changes: 5 additions & 0 deletions api/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import globals from "globals";
import pluginJs from "@eslint/js";
import tseslint from "typescript-eslint";

export default [{ files: ["**/*.{js,mjs,cjs,ts}"] }, { languageOptions: { globals: globals.node } }, pluginJs.configs.recommended, ...tseslint.configs.recommended];
Loading

0 comments on commit 28f1c2b

Please sign in to comment.