-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(chore) O3-2009: Setup form engine CI and NPM
- Loading branch information
1 parent
a17a7cb
commit 256edbc
Showing
3 changed files
with
148 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
|
||
name: OpenMRS CI | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
release: | ||
types: | ||
- created | ||
|
||
env: | ||
ESM_NAME: "openmrs-form-engine-lib" | ||
JS_NAME: "openmrs-form-engine-lib.js" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Use Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '16' | ||
- run: yarn install | ||
- run: yarn lint | ||
- run: yarn run test | ||
- run: yarn build | ||
- name: Upload Artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: dist | ||
path: | | ||
dist | ||
pre_release: | ||
runs-on: ubuntu-latest | ||
|
||
needs: build | ||
|
||
if: ${{ github.event_name == 'push' }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Use Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '16' | ||
registry-url: "https://registry.npmjs.org" | ||
|
||
- name: Cache dependencies | ||
id: cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: '**/node_modules' | ||
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} | ||
|
||
- name: Install dependencies | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
run: yarn install --immutable | ||
|
||
- name: Setup local cache server for Turborepo | ||
uses: felixmosh/turborepo-gh-artifacts@v2 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
server-token: ${{ env.TURBO_TOKEN }} | ||
|
||
- name: Version | ||
run: yarn lerna version "$(node -e "console.log(require('semver').inc(require('./lerna.json').version, 'patch'))")-pre.${{ github.run_number }}" --no-git-tag-version --no-push --yes | ||
|
||
- name: Build | ||
run: yarn turbo run build --color --concurrency=5 | ||
|
||
- run: git config user.email "info@openmrs.org" && git config user.name "OpenMRS CI" | ||
- run: git add . && git commit -m "Prerelease version" --no-verify | ||
|
||
- name: Pre-release | ||
run: yarn run ci:prepublish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} | ||
|
||
- name: Upload build artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: packages | ||
path: | | ||
packages/**/dist | ||
release: | ||
runs-on: ubuntu-latest | ||
|
||
needs: build | ||
|
||
if: ${{ github.event_name == 'release' }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Use Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '16' | ||
registry-url: "https://registry.npmjs.org" | ||
|
||
- name: Cache dependencies | ||
id: cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: '**/node_modules' | ||
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} | ||
|
||
- name: Install dependencies | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
run: yarn install --immutable | ||
|
||
- name: Setup local cache server for Turborepo | ||
uses: felixmosh/turborepo-gh-artifacts@v2 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
server-token: ${{ env.TURBO_TOKEN }} | ||
|
||
- name: Build | ||
run: yarn turbo run build --color --concurrency=5 | ||
|
||
- name: Publish | ||
run: yarn run ci:publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} |
This file was deleted.
Oops, something went wrong.