Skip to content

Commit

Permalink
chore: set up github actions and linting configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
d-rita committed Nov 21, 2024
1 parent 5c69fe0 commit bbcfed6
Show file tree
Hide file tree
Showing 11 changed files with 1,700 additions and 74 deletions.
13 changes: 13 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// eslint-disable-next-line @typescript-eslint/no-require-imports
const { config } = require('@dhis2/cli-style')

module.exports = {
extends: [
config.eslintReact,
'plugin:@typescript-eslint/recommended',
'plugin:import/typescript',
],
rules: {
'import/extensions': 'off',
},
}
1 change: 1 addition & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_extends: .github
12 changes: 12 additions & 0 deletions .github/workflows/comment-and-close.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: comment-and-close

on:
issues:
types: [opened]

jobs:
comment-and-close:
uses: dhis2/workflows-platform/.github/workflows/comment-and-close.yml@v1
if: '!contains(github.event.issue.sender.login , fromJson(''["dhis2-bot", "kodiakhq", "dependabot"]''))'
with:
issue_number: ${{ github.event.issue.number }}
14 changes: 14 additions & 0 deletions .github/workflows/deploy-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: deploy-pr

on:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true

jobs:
deploy:
uses: dhis2/workflows-platform/.github/workflows/deploy-pr.yml@v1
if: '!github.event.pull_request.head.repo.fork'
secrets: inherit
17 changes: 17 additions & 0 deletions .github/workflows/deploy-production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: deploy-production

on:
push:
branches:
- master

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
deploy:
uses: dhis2/workflows-platform/.github/workflows/deploy-production.yml@v1
secrets: inherit
with:
branch: master
13 changes: 13 additions & 0 deletions .github/workflows/lint-pr-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: lint-pr-title

on:
pull_request:
types: ['opened', 'edited', 'reopened', 'synchronize']

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true

jobs:
lint-pr-title:
uses: dhis2/workflows-platform/.github/workflows/lint-pr-title.yml@v1
29 changes: 29 additions & 0 deletions .github/workflows/test-and-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: test-and-release

on: push

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
# Cancel previous runs if not on a release branch
cancel-in-progress: ${{ !contains(fromJSON('["refs/heads/main", "ref/heads/main"]'), github.ref) }}

jobs:
lint-commits:
uses: dhis2/workflows-platform/.github/workflows/lint-commits.yml@v1
lint:
uses: dhis2/workflows-platform/.github/workflows/lint.yml@v1
# test:
# uses: dhis2/workflows-platform/.github/workflows/test.yml@v1
# e2e:
# uses: dhis2/workflows-platform/.github/workflows/legacy-e2e.yml@v1
# # Skips forks and dependabot PRs
# if: '!github.event.push.repository.fork'
# secrets: inherit
# with:
# api_version: 42
release:
needs: [lint-commits, lint, test]
uses: dhis2/workflows-platform/.github/workflows/release.yml@v1
# Skips forks and dependabot PRs
if: '!github.event.push.repository.fork'
secrets: inherit
7 changes: 7 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// eslint-disable-next-line @typescript-eslint/no-require-imports
const { config } = require('@dhis2/cli-style')

module.exports = {
// eslint-disable-next-line @typescript-eslint/no-require-imports
...require(config.prettier),
}
47 changes: 26 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
{
"name": "datastore-app",
"version": "1.0.0",
"description": "",
"license": "BSD-3-Clause",
"private": true,
"scripts": {
"build": "d2-app-scripts build",
"start": "d2-app-scripts start",
"test": "d2-app-scripts test",
"deploy": "d2-app-scripts deploy"
},
"devDependencies": {
"@dhis2/cli-app-scripts": "^12.0.0-alpha.24",
"@types/jest": "^29.5.14",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"typescript": "^5"
},
"dependencies": {
"@dhis2/app-runtime": "^3.11.3"
}
"name": "datastore-app",
"version": "200.0.0",
"description": "",
"license": "BSD-3-Clause",
"private": true,
"scripts": {
"build": "d2-app-scripts build",
"lint": "yarn tsc && d2-style check",
"lint:staged": "d2-style check --staged",
"format": "d2-style apply",
"format:staged": "d2-style apply --staged",
"start": "d2-app-scripts start",
"test": "d2-app-scripts test",
"deploy": "d2-app-scripts deploy"
},
"devDependencies": {
"@dhis2/cli-app-scripts": "^12.0.0-alpha.24",
"@dhis2/cli-style": "^10.7.5",
"@types/jest": "^29.5.14",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"typescript": "^5"
},
"dependencies": {
"@dhis2/app-runtime": "^3.11.3"
}
}
14 changes: 7 additions & 7 deletions src/App.module.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
.container {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: 1rem;
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: 1rem;
}
Loading

0 comments on commit bbcfed6

Please sign in to comment.