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 3030678
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 50 deletions.
77 changes: 39 additions & 38 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,56 +9,51 @@ 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 }}
APP_GRAPHQL_API_ENDPOINT: ${{ vars.APP_GRAPHQL_API_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'
# unimported:
# name: Find unimported files
# environment: 'test'
# 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
# - name: Install dependencies
# run: yarn install --frozen-lockfile

- name: Run test
run: yarn test
unimported:
name: Find unimported files
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 unimported
run: yarn unimported
# - name: Run unimported
# run: yarn unimported
# fix use better tool, this is deprecated
lint-js:
name: Lint JS
environment: 'test'
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: 'test'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -68,38 +63,44 @@ 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: 'test'
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: 'test'
needs: [lint-js, css-lint, typecheck]
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: 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
8 changes: 6 additions & 2 deletions .unimportedrc.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
{
"entry": ["./src/index.tsx"],
"ignorePatterns": ["**/node_modules/**", "build/**"],
"ignoreUnimported": ["**/*.d.ts", "**/*.test.*"],
"ignoreUnimported": ["**/*.d.ts", "**/*.test.*", "**/generated/**"],
"ignoreUnused": [
"@apollo/client",
"@graphql-codegen/introspection",
"@graphql-codegen/typescript-operations",
"@togglecorp/re-map",
"@sentry/react"
],
"ignoreUnresolved": ["@graphql-typed-document-node/core"],
"extensions": [".ts", ".js", ".tsx", ".jsx"],
"aliases": {
"#utils/*": ["./src/utils/*"],
"#views/*": ["./src/views/*"]
"#views/*": ["./src/views/*"],
"#generated/*": ["./generated/*"],
"#components/*": ["./src/components/*"],
"#hooks/*": ["./src/hooks/*"]
}
}
1 change: 1 addition & 0 deletions backend
Submodule backend added at 8f8391
10 changes: 0 additions & 10 deletions src/hooks/domain/useCurrentLanguage.ts

This file was deleted.

0 comments on commit 3030678

Please sign in to comment.