Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add reusable workflows #618

Merged
33 commits merged into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
f55a11f
ci: add reusable workflow
Jun 10, 2024
f907bcc
ci: update actions
Jun 10, 2024
d853c61
ci: abstract test
Jun 10, 2024
522db87
ci: add build job
Jun 10, 2024
e308e64
ci: abstract e2e
Jun 10, 2024
c0becf1
ci: add secrets
Jun 11, 2024
134f165
style: fix with prettier
Jun 11, 2024
c2cc7ed
ci: use latest cypress action
Jun 11, 2024
db05789
ci: cancel previous runs if not on release branch
Jun 11, 2024
f1e8cba
ci: abstract release
Jun 11, 2024
5b1c9a0
ci: remove git author
Jun 11, 2024
a12f2b7
ci: remove redundant build task
Jun 11, 2024
2e82a57
ci: add comment
Jun 11, 2024
6b6206f
ci: add workflow name
Jun 11, 2024
8a19313
ci: abstract netlify workflows
Jun 11, 2024
c54fc42
ci: only run workflows that need secrets where they are available
Jun 11, 2024
cefd5c3
ci: add reusable commitlint workflows
Jun 11, 2024
1853de4
ci: update commitlint action
Jun 11, 2024
f82d91b
ci: cancel previous pr title linting runs
Jun 11, 2024
51edf35
style: fix with prettier
Jun 12, 2024
6c58814
ci: downgrade commitlint to v5
Jun 11, 2024
dd534f7
ci: update netlify deploy
Jun 11, 2024
d090e76
ci: use head_ref for pull_request action trigger
Jun 11, 2024
2f40d04
ci: add reusable issue workflow
Jun 12, 2024
c12842c
ci: use gh cli to close issues
Jun 12, 2024
dea2794
style: fix formatting
Jun 17, 2024
b9e84bd
ci: move reusable workflows to separate test repo
Jun 17, 2024
92cdd36
ci: specify branch to deploy production from
Jun 19, 2024
32078b3
ci: fix pull request condition
Jun 19, 2024
b1b547e
ci: refer to workflows by version
Jul 2, 2024
df1a967
ci: add name for comment wf
Jul 2, 2024
82fbd6a
ci: move upstream workflows
Jul 8, 2024
4ed0295
ci: address review comments
Jul 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions .github/workflows/comment-and-close.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
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.issues.sender.login , fromJson('["dhis2-bot", "kodiakhq", "dependabot"]'))
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-netlify-deploy-pr.yml

This file was deleted.

56 changes: 0 additions & 56 deletions .github/workflows/dhis2-netlify-deploy-production.yml

This file was deleted.

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

This file was deleted.

38 changes: 0 additions & 38 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
27 changes: 27 additions & 0 deletions .github/workflows/test-and-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
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(github.ref, fromJSON('["master", "main"]')) }}

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/e2e.yml@v1
# Skips forks and dependabot PRs
if: '!github.event.push.repository.fork'
secrets: inherit
release:
needs: [lint-commits, lint, test, e2e]
uses: dhis2/workflows-platform/.github/workflows/release.yml@v1
# Skips forks and dependabot PRs
if: '!github.event.push.repository.fork'
secrets: inherit
Loading