Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Pushing a working branch to use as test for the form engine ci #87

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
128 changes: 120 additions & 8 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
uses: actions/setup-node@v3
- run: yarn install
- run: yarn lint
- run: yarn run test
Expand All @@ -41,7 +39,7 @@ jobs:

needs: build

if: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' }}
# if: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' }}

steps:
- uses: actions/checkout@v3
Expand All @@ -61,7 +59,6 @@ jobs:
yarn config set npmAuthToken ${{ secrets.NPM_OHRI_ACCESS_TOKEN }}
- run: yarn npm publish --tag next


release:
runs-on: ubuntu-latest

Expand All @@ -77,9 +74,124 @@ jobs:
# Setup .npmrc file to publish to npm
uses: actions/setup-node@v3
with:
node-version: "16.x"
node-version: "18.x"
registry-url: "https://registry.npmjs.org"
- run: npm ci
- run: npm publish --tag latest
- run: yarn
- run: |
yarn config set npmAlwaysAuth true
yarn config set npmAuthToken ${{ secrets.NPM_OHRI_ACCESS_TOKEN }}
- run: yarn npm publish --access public --tag latest
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_OHRI_ACCESS_TOKEN }}

bump-form-engine_ohri:
runs-on: ubuntu-latest

needs: pre_release

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
repository: UCSF-IGHS/openmrs-esm-ohri
ref: working

- name: Install dependencies
run: yarn

- name: Bump form engine
run: yarn ci:bump-form-engine-lib

- name: Commit changes
run: |
git config user.email "github-actions@github.com"
git config user.name "GitHub Actions"
git add yarn.lock
git commit -m "(chore) bump-form-engine"

- name: Create PR
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.ACTIONS_OHRI_PAT }}
commit-message: "(chore) bump-form-engine"
title: "(chore) Bump form engine"
body: " 🤖 This is an Automated PR that bumps the form engine next tag once its available,
to 3 main esm's"
branch: chore/bump-form-engine
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
base: working
labels: |
bot
automated pr

# bump-form-engine_patient:
# runs-on: ubuntu-latest

# needs: pre_release

# steps:
# - name: Checkout code
# uses: actions/checkout@v3
# with:
# repository: openmrs/openmrs-esm-patient-chart
# ref: main

# - name: Install dependencies
# run: yarn

# - name: Bump form engine
# run: yarn ci:bump-form-engine-lib

# - name: Commit changes
# run: |
# git config user.email "github-actions@github.com"
# git config user.name "GitHub Actions"
# git add yarn.lock
# git commit -m "(chore) bump-form-engine"

# - name: Create PR
# uses: peter-evans/create-pull-request@v3
# with:
# token: ${{ secrets.ACTIONS_OHRI_PAT }}
# commit-message: "(chore) bump-form-engine"
# title: "(chore) Bump form engine"
# body: "This is an Automated PR that bumps the form engine next tag once its available,
# to 3 main esm's"
# branch: chore/bump-form-engine
# base: working

# bump-form-engine_builder:
# runs-on: ubuntu-latest

# needs: pre_release

# steps:
# - name: Checkout code
# uses: actions/checkout@v3
# with:
# repository: openmrs/openmrs-esm-form-builder
# ref: main

# - name: Install dependencies
# run: yarn

# - name: Bump form engine
# run: yarn ci:bump-form-engine-lib

# - name: Commit changes
# run: |
# git config user.email "github-actions@github.com"
# git config user.name "GitHub Actions"
# git add yarn.lock
# git commit -m "(chore) bump-form-engine"

# - name: Create PR
# uses: peter-evans/create-pull-request@v3
# with:
# token: ${{ secrets.ACTIONS_OHRI_PAT }}
# commit-message: "(chore) bump-form-engine"
# title: "(chore) Bump form engine"
# body: "This is an Automated PR that bumps the form engine next tag once its available,
# to 3 main esm's"
# branch: chore/bump-form-engine
# base: working
18 changes: 18 additions & 0 deletions .github/workflows/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## Requirements

- [ ] This PR has a title that briefly describes the work done including the ticket number. If there is a ticket, make sure your PR title includes a [conventional commit](https://o3-dev.docs.openmrs.org/#/getting_started/contributing?id=your-pr-title-should-indicate-the-type-of-change-it-is) label. See existing PR titles for inspiration.
- [ ] My work conforms to the [OpenMRS 3.0 Styleguide](https://om.rs/styleguide) and [design documentation](https://zeroheight.com/23a080e38/p/880723-introduction).
- [ ] My work includes tests or is validated by existing tests.

## Summary
<!-- Please describe what problems your PR addresses. -->

## Screenshots
<!-- Required if you are making UI changes. -->

## Related Issue
<!-- Paste the link to the Jira ticket here if one exists. -->
<!-- https://issues.openmrs.org/browse/O3- -->

## Other
<!-- Anything not covered above -->
46 changes: 46 additions & 0 deletions .github/workflows/size.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Report bundle size

on:
push:
branches:
- '*'
pull_request:
branches:
- main
- dev

jobs:
build_yarn:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: preactjs/compressed-size-action@v2
with:
minimum-change-threshold: 10000 # 10 KB



build_turbo:
runs-on: ubuntu-latest
env:
TURBO_API: 'http://127.0.0.1:9080'
TURBO_TOKEN: ${{ secrets.TURBO_SERVER_TOKEN }}
TURBO_TEAM: ${{ github.repository_owner }}

steps:
- uses: actions/checkout@v3

- name: Setup a local cache server for Turborepo
uses: felixmosh/turborepo-gh-artifacts@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
server-token: ${{ env.TURBO_TOKEN }}

- name: Compute bundle size differences
uses: preactjs/compressed-size-action@v2
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
minimum-change-threshold: 10000 # 10 KB
build-script: "turbo run build --color"
1 change: 0 additions & 1 deletion turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"$schema": "https://turborepo.org/schema.json",
"pipeline": {
"build": {
"dependsOn": ["^build"],
"outputs": ["dist/**"]
},
"test": {
Expand Down