Skip to content

Commit

Permalink
feat: integrate backend using git submodules to fix CI lint workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
samshara committed Apr 11, 2024
1 parent 646d94b commit 7e1e324
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 27 deletions.
47 changes: 21 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Lint, Build and Test
name: Lint & Build

on:
pull_request:
Expand All @@ -9,26 +9,13 @@ on:
env:
APP_TITLE: ${{ vars.APP_TITLE }}
APP_MAPBOX_ACCESS_TOKEN: ${{ vars.APP_MAPBOX_ACCESS_TOKEN }}
APP_GRAPHQL_CODEGEN_ENDPOINT: ${{ vars.APP_GRAPHQL_CODEGEN_ENDPOINT }}
GITHUB_WORKFLOW: true

jobs:
test:
name: Run tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'

- name: Install dependencies
run: yarn install

- name: Run test
run: yarn test
unimported:
name: Find unimported files
environment: 'CI'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -38,27 +25,31 @@ jobs:
cache: 'yarn'

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

- name: Run unimported
run: yarn unimported
lint-js:
name: Lint JS
environment: 'CI'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'

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

- name: Lint
run: yarn lint:js
- name: Lint Javascript
run: yarn generate && yarn lint:js
css-lint:
name: Lint CSS
environment: 'CI'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -68,28 +59,32 @@ jobs:
cache: 'yarn'

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

- name: Css Lint
run: yarn lint:css
typecheck:
name: Typecheck
environment: 'CI'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'

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

- name: Typecheck
run: yarn typecheck
run: yarn generate && yarn typecheck
build:
name: Build
needs: [lint-js, css-lint, typecheck, test]
environment: 'CI'
needs: [lint-js, css-lint, typecheck]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -99,7 +94,7 @@ jobs:
cache: 'yarn'

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

- name: Build
run: yarn build
run: yarn generate && yarn build
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "backend"]
path = backend
url = [email protected]:IFRCGo/alert-hub-backend.git
1 change: 1 addition & 0 deletions backend
Submodule backend added at 2ff119
2 changes: 1 addition & 1 deletion codegen.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { CodegenConfig } from '@graphql-codegen/cli';

const config: CodegenConfig = {
schema: process.env.APP_GRAPHQL_CODEGEN_ENDPOINT,
schema: './backend/schema.graphql',
documents: [
'src/**/*.tsx',
'src/**/*.ts'
Expand Down

0 comments on commit 7e1e324

Please sign in to comment.