Skip to content

Commit 403cc2b

Browse files
committed
(chore) Add CI scripts
1 parent 64abdb4 commit 403cc2b

File tree

3 files changed

+114
-23
lines changed

3 files changed

+114
-23
lines changed

.github/workflows/bundle-size.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Report bundle size
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
env:
12+
TURBO_API: 'http://127.0.0.1:9080'
13+
TURBO_TOKEN: 'turbo-token'
14+
TURBO_TEAM: ${{ github.repository_owner }}
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: actions/setup-node@v4
19+
with:
20+
node-version: 20
21+
22+
- name: 🚀 Setup a local cache server for Turborepo
23+
uses: felixmosh/turborepo-gh-artifacts@v3
24+
with:
25+
repo-token: ${{ secrets.GITHUB_TOKEN }}
26+
server-token: ${{ env.TURBO_TOKEN }}
27+
28+
- name: 📊 Compute bundle size report
29+
uses: preactjs/compressed-size-action@v2
30+
with:
31+
repo-token: '${{ secrets.GITHUB_TOKEN }}'
32+
minimum-change-threshold: 10000 # 10 KB
33+
build-script: 'turbo run build --color --concurrency=5'

.github/workflows/tx-pull.yml

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,50 +9,41 @@ name: "Scheduled Transifex Update"
99
jobs:
1010
pull-translations-from-transifex:
1111
name: pull-translations-from-transifex
12+
1213
runs-on: ubuntu-latest
13-
14-
# Required permissions for creating and managing PRs
1514
permissions:
1615
contents: write
1716
pull-requests: write
1817

1918
steps:
20-
# Step 1: Check out repository
21-
- name: Checkout repository
22-
uses: actions/checkout@v4
23-
24-
# Step 2: Pull translations from Transifex
25-
- name: Pull translations from Transifex
19+
- uses: actions/checkout@v4
20+
- name: 🌐 Push source file using transifex client
2621
uses: transifex/cli-action@v2
2722
with:
2823
token: ${{ secrets.TRANSIFEX_TOKEN }}
2924
args: pull --force --all
30-
31-
# Step 3: Create PR with translation updates
32-
- name: Create PR if necessary
33-
id: cpr
25+
- name: 🔄 Create PR if necessary
3426
uses: peter-evans/create-pull-request@v7
3527
with:
36-
commit-message: "(chore) Update translations from Transifex"
37-
title: "(chore) Update translations from Transifex"
28+
commit-message: '(chore) Update translations from Transifex'
29+
title: '(chore) Update translations from Transifex'
3830
body: |
39-
Automated updates of translations pulled from Transifex
31+
# OpenMRS Translation Updates
4032
41-
This PR was automatically generated by the Scheduled Transifex Update workflow.
42-
branch: "chore/update-transifex"
43-
author: "OpenMRS Bot <infrastructure@openmrs.org>"
44-
token: ${{ secrets.OMRS_BOT_GH_TOKEN }}
33+
This PR contains updates to the translations pulled from Transifex
4534
35+
> This PR was automatically generated and will be automatically merged if checks pass.
36+
branch: 'chore/update-transifex'
37+
author: 'OpenMRS Bot <infrastructure@openmrs.org>'
38+
token: ${{ secrets.OMRS_BOT_GH_TOKEN }}
4639
# Step 4: Auto-approve the PR if created or updated
4740
- name: ✅ Auto approve PR
4841
if: steps.cpr.outputs.pull-request-operation == 'created' || steps.cpr.outputs.pull-request-operation == 'updated'
4942
run: gh pr review --approve "${{ steps.cpr.outputs.pull-request-number }}"
5043
env:
5144
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52-
53-
# Step 5: Auto-merge the PR if created or updated
54-
- name: 🔀 Auto merge PR
45+
- name: 🔀 Automerge PR
5546
if: steps.cpr.outputs.pull-request-operation == 'created' || steps.cpr.outputs.pull-request-operation == 'updated'
5647
run: gh pr merge --auto --squash "${{ steps.cpr.outputs.pull-request-number }}"
5748
env:
58-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49+
GH_TOKEN: ${{ secrets.OMRS_BOT_GH_TOKEN }}
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
on:
2+
workflow_dispatch:
3+
schedule:
4+
# every hour
5+
- cron: '30 * * * *'
6+
7+
name: 'Check for OpenMRS Dependency Updates'
8+
9+
jobs:
10+
check-for-updates:
11+
name: Check for updates to OpenMRS libraries
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: write
15+
pull-requests: write
16+
if: github.repository_owner == 'openmrs'
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
- name: 🟢 Use Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: 20
24+
- name: 💾 Cache dependencies
25+
id: cache
26+
uses: actions/cache@v4
27+
with:
28+
path: '**/node_modules'
29+
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
30+
- name: 📦 Install dependencies
31+
if: steps.cache.outputs.cache-hit != 'true'
32+
run: yarn install --immutable
33+
- name: ✅ Check for updates
34+
run: node ./tools/update-openmrs-deps.mjs
35+
- name: ⬆️ Create PR if necessary
36+
id: cpr
37+
uses: peter-evans/create-pull-request@v7
38+
with:
39+
commit-message: '(chore) Update OpenMRS dependencies'
40+
title: '(chore) Update OpenMRS dependencies'
41+
body: |
42+
# OpenMRS Dependencies Update
43+
44+
This PR contains updates to OpenMRS dependencies.
45+
46+
## Changes
47+
* Automated dependency updates for OpenMRS packages
48+
* Generated by the OpenMRS Dependency Update workflow
49+
50+
## Verification
51+
- [ ] All dependencies are valid versions
52+
- [ ] No breaking changes introduced
53+
54+
> This PR was automatically generated and will be automatically merged if checks pass.
55+
branch: 'chore/update-openmrs-deps'
56+
author: 'OpenMRS Bot <infrastructure@openmrs.org>'
57+
token: ${{ secrets.OMRS_BOT_GH_TOKEN }}
58+
- name: ✅ Auto approve PR
59+
if: steps.cpr.outputs.pull-request-operation == 'created' || steps.cpr.outputs.pull-request-operation == 'updated'
60+
run: gh pr review --approve "${{ steps.cpr.outputs.pull-request-number }}"
61+
env:
62+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
63+
- name: 🔀 Automerge PR
64+
if: steps.cpr.outputs.pull-request-operation == 'created' || steps.cpr.outputs.pull-request-operation == 'updated'
65+
run: gh pr merge --auto --squash "${{ steps.cpr.outputs.pull-request-number }}"
66+
env:
67+
GH_TOKEN: ${{ secrets.OMRS_BOT_GH_TOKEN }}

0 commit comments

Comments
 (0)