Skip to content

Commit

Permalink
ci: update to shared workflows (#395)
Browse files Browse the repository at this point in the history
* ci: update to shared workflows

* chore: update cli-app-scripts and ui

* chore: update app-runtime

* chore: ignore styled jsx property

* chore: fix linting errors

* fix: fix failing test
  • Loading branch information
ismay authored Sep 30, 2024
1 parent 699430e commit 57121f6
Show file tree
Hide file tree
Showing 13 changed files with 6,577 additions and 7,591 deletions.
8 changes: 7 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@ module.exports = {
extends: [config.eslintReact],
rules: {
'max-params': [
2,
'error',
{
max: 4,
},
],
'react/no-unknown-property': [
'error',
{
ignore: ['jsx', 'global'],
},
],
},
}
13 changes: 6 additions & 7 deletions .github/workflows/comment-and-close.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
name: comment-and-close

on:
issues:
types: [opened]

jobs:
comment-and-close:
runs-on: ubuntu-latest
steps:
- uses: vardevs/candc@v1
with:
close-comment: 'If you would like to file a bug report or feature request, please refer to our issue tracker: https://jira.dhis2.org'
exempt-users: dhis2-bot,dependabot,kodiakhq
github-token: ${{secrets.DHIS2_BOT_GITHUB_TOKEN}}
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
54 changes: 0 additions & 54 deletions .github/workflows/dhis2-preview-pr.yml

This file was deleted.

153 changes: 0 additions & 153 deletions .github/workflows/dhis2-verify-app.yml

This file was deleted.

32 changes: 0 additions & 32 deletions .github/workflows/dhis2-verify-commits.yml

This file was deleted.

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
22 changes: 22 additions & 0 deletions .github/workflows/test-and-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
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/master", "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
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
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"cypress:run": "yarn d2-utils-cypress run"
},
"devDependencies": {
"@dhis2/cli-app-scripts": "7.8.0",
"@dhis2/cli-app-scripts": "^11.7.1",
"@dhis2/cli-style": "^10.4.1",
"@dhis2/cli-utils-cypress": "^2.2.1",
"enzyme": "^3.11.0",
Expand All @@ -31,7 +31,7 @@
"redux-mock-store": "^1.5.4"
},
"dependencies": {
"@dhis2/app-runtime": "^2.8.0",
"@dhis2/app-runtime": "^3.10.6",
"@dhis2/app-runtime-adapter-d2": "^1.0.1",
"@dhis2/d2-i18n": "^1.1.0",
"@dhis2/d2-ui-app": "^2.0.0",
Expand All @@ -40,7 +40,7 @@
"@dhis2/d2-ui-org-unit-tree": "^7.0.8",
"@dhis2/d2-ui-sharing-dialog": "^7.0.8",
"@dhis2/d2-ui-table": "^7.0.8",
"@dhis2/ui": "^6.5.5",
"@dhis2/ui": "^9.11.3",
"chart.js": "^2.7.3",
"classnames": "^2.2.6",
"connected-react-router": "^6.3.1",
Expand Down
2 changes: 1 addition & 1 deletion src/components/AppRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import { DataSetReport } from '../pages/DataSetReport.js'
import Home from '../pages/home/Home.js'
import { OrganisationUnitDistributionReport } from '../pages/OrganisationUnitDistributionReport.js'
import { ReportingRateSummary } from '../pages/ReportingRateSummary.js'
import { Resource } from '../pages/Resource.js'
import { AddEditResource } from '../pages/resource/AddEditResource.js'
import { Resource } from '../pages/Resource.js'
import { ConnectedAddEditStdReport } from '../pages/standard-report/AddEditStdReport.js'
import StyledHtmlReport from '../pages/standard-report/StyledHtmlReport.js'
import { StandardReport } from '../pages/StandardReport.js'
Expand Down
2 changes: 1 addition & 1 deletion src/redux/actions/__tests__/standardReportTables.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe('Actions - standardReportTables', () => {
])

getStandardReportTables.mockImplementationOnce(() =>
Promise.resolve([{ id: '1337', name: 'foobar' }])
Promise.resolve([{ id: '1337', displayName: 'foobar' }])
)

store.dispatch(loadStandardReportTables()).then(() => {
Expand Down
Loading

1 comment on commit 57121f6

@dhis2-bot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.