Skip to content

Commit

Permalink
add github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
achou11 committed Apr 10, 2024
1 parent d16699f commit 40cb05a
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 3 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: CI

on:
push:
branches: [main]
pull_request:
# By default, a workflow only runs when a pull_request 's activity type is
# opened , synchronize , or reopened. Adding ready_for_review here ensures
# that CI runs when a PR is marked as not a draft, since we skip CI when a
# PR is draft
types: [opened, synchronize, reopened, ready_for_review]

jobs:
backend:
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: false
defaults:
run:
working-directory: './src/backend'
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- name: Install deps
run: |
npm ci --ignore-scripts
npm run postinstall
- name: Check types
run: npm run types

frontend:
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- name: Install deps
run: npm ci
- name: Build translations
run: npm run build:translations
- name: Build Intl polyfills
run: npm run build:intl-polyfills
- name: Check types
run: npm run types
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"deep-clean": "./scripts/deep-clean.sh",
"build:translations": "node ./scripts/build-translations.js ",
"build:intl-polyfills": "node ./scripts/build-intl-polyfills.mjs",
"extract-messages": "formatjs extract 'src/frontend/**/*.{ts,tsx}' --ignore='**/*.d.ts' --format crowdin --out-file ./messages/en.json"
"extract-messages": "formatjs extract 'src/frontend/**/*.{ts,tsx}' --ignore='**/*.d.ts' --format crowdin --out-file ./messages/en.json",
"types": "tsc --noEmit"
},
"dependencies": {
"@bam.tech/react-native-image-resizer": "^3.0.7",
Expand Down
2 changes: 1 addition & 1 deletion src/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"main": "index.js",
"scripts": {
"build": "node ./scripts/bundle-backend.mjs --entry=index.js --output=index.bundle.js",
"lint": "tsc",
"types": "tsc --noEmit",
"postinstall": "patch-package"
},
"author": "Digital Democracy",
Expand Down
1 change: 0 additions & 1 deletion src/backend/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"./node_modules/@digidem/types/vendor/*/index.d.ts"
]
},
"resolveJsonModule": true,
"allowJs": true,
"checkJs": true,
"noEmit": true,
Expand Down

0 comments on commit 40cb05a

Please sign in to comment.