-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2352f6c
commit a78d446
Showing
1 changed file
with
17 additions
and
23 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 |
---|---|---|
@@ -1,5 +1,10 @@ | ||
name: OpenMRS CI | ||
|
||
env: | ||
TURBO_API: 'http://127.0.0.1:9080' | ||
TURBO_TOKEN: ${{ secrets.TURBO_SERVER_TOKEN }} | ||
TURBO_TEAM: ${{ github.repository_owner }} | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
|
@@ -10,33 +15,28 @@ on: | |
- created | ||
|
||
jobs: | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
steps: | ||
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: Use Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "16" | ||
|
||
- 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 --frozen-lockfile | ||
|
||
- name: Setup a local cache server for Turborepo | ||
uses: felixmosh/turborepo-gh-artifacts@v2 | ||
with: | ||
|
@@ -45,10 +45,10 @@ jobs: | |
|
||
- name: Run lint, typecheck and tests | ||
run: yarn verify | ||
|
||
- name: Run build | ||
run: yarn turbo run build --color --concurrency=5 | ||
|
||
- name: Upload build artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
|
@@ -58,9 +58,7 @@ jobs: | |
pre_release: | ||
runs-on: ubuntu-latest | ||
|
||
needs: build | ||
|
||
if: ${{ github.event_name == 'push' }} | ||
|
||
steps: | ||
|
@@ -70,7 +68,7 @@ jobs: | |
with: | ||
node-version: "16" | ||
registry-url: "https://registry.npmjs.org" | ||
|
||
- name: Cache dependencies | ||
id: cache | ||
uses: actions/cache@v3 | ||
|
@@ -81,22 +79,20 @@ jobs: | |
- name: Install dependencies | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
run: yarn install --immutable | ||
|
||
- 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 | ||
- run: yarn turbo run build --color --concurrency=5 | ||
- run: git config user.email "[email protected]" && 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 }} | ||
|
||
release: | ||
runs-on: ubuntu-latest | ||
|
||
needs: build | ||
|
||
if: ${{ github.event_name == 'release' }} | ||
|
||
steps: | ||
|
@@ -106,7 +102,7 @@ jobs: | |
with: | ||
node-version: "16" | ||
registry-url: "https://registry.npmjs.org" | ||
|
||
- name: Cache dependencies | ||
id: cache | ||
uses: actions/cache@v3 | ||
|
@@ -120,23 +116,21 @@ jobs: | |
|
||
- 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 }} | ||
|
||
deploy_admin_tools: | ||
runs-on: ubuntu-latest | ||
|
||
needs: pre_release | ||
|
||
if: ${{ github.event_name == 'push' }} | ||
|
||
steps: | ||
- name: Trigger RefApp Build | ||
uses: fjogeleit/http-request-action@master | ||
with: | ||
url: https://ci.openmrs.org/rest/api/latest/queue/REFAPP-D3X | ||
url: https://ci.openmrs.org/rest/api/latest/queue/O3-BF | ||
method: "POST" | ||
customHeaders: '{ "Authorization": "Bearer ${{ secrets.BAMBOO_TOKEN }}" }' |