Skip to content

Commit

Permalink
removed coverage and dist from being tracked by git. (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
donaldkibet authored Aug 11, 2022
1 parent a470c8b commit 590924b
Show file tree
Hide file tree
Showing 37 changed files with 201 additions and 32,906 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
end_of_line = lf

[*.md]
trim_trailing_whitespace = false
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
src/**/*.test.tsx
src/**/*.spec.tsx
**/*.d.tsx
**/node_modules/**/*
16 changes: 16 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint"
],
"extends": [
"ts-react-important-stuff",
"plugin:prettier/recommended"
],
"rules": {
"curly": [
"error",
"all"
]
}
}
159 changes: 159 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
name: OpenMRS CI

on:
push:
branches: [main]
pull_request:
branches: [main]
release:
types:
- created

jobs:
build:
runs-on: ubuntu-latest
permissions:
actions: read

steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v1
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: npx lerna bootstrap

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

- name: Run tests
run: yarn run test

- name: Run lint and typechecking
run: yarn run verify

- name: Run build
run: yarn turbo run build --color --api="http://127.0.0.1:9080" --token="${{ secrets.TURBO_SERVER_TOKEN }}" --team="${{ github.repository_owner }}"

- name: Upload build artifacts
uses: actions/upload-artifact@v2
with:
name: packages
path: |
packages/**/dist
deploy_esm_patient_flas_app:
runs-on: ubuntu-latest

env:
DIR_NAME: "esm-patient-flags-app"
ESM_NAME: "@kenyaemr/esm-patient-flags-app"
JS_NAME: "kenyaemr-esm-patient-flags-app.js"

needs: build

if: ${{ github.event_name == 'push' }}

steps:
- name: Download Artifacts
uses: actions/download-artifact@v2

- name: Compute Timestamp
run: echo "TIMESTAMP=$(date +'%Y-%m-%d')" >> $GITHUB_ENV

- name: Prepare Directory
shell: bash
run: |
mkdir -p dist/${{ env.ESM_NAME }}/${{ env.TIMESTAMP }}_${{ github.sha }}
mv packages/${{ env.DIR_NAME }}/dist/*.* dist/${{ env.ESM_NAME }}/${{ env.TIMESTAMP }}_${{ github.sha }}/
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@v1
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: npx lerna bootstrap

- name: Build
run: yarn turbo run build --color

- name: Patch
run: yarn lerna version patch --no-git-tag-version --no-push --yes

- name: Version
run: npx lerna version "$(node -e "console.log(require('./lerna.json').version)")-pre.${{ github.run_number }}" --no-git-tag-version --yes

- run: git config user.email "[email protected]" && git config user.name "KenyaEMR 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:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v1
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: npx lerna bootstrap

- name: Build
run: yarn turbo run build --color

- name: Publish
run: yarn run ci:publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,5 @@ dist
.idea/

.DS_Store
.turbo

.turbo/
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dist/
node_modules/
**/*.md
**/*.json
**/*.yml
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ yarn start --sources 'packages/esm-<insert-package-name>-app'
You could provide `yarn start` with as many `sources` arguments as you require. For example, to run the patient registration and patient search modules only, use:

```bash
yarn start --sources 'packages/esm-patient-search-app' --sources 'packages/esm-patient-registration-app'
yarn start --sources 'packages/esm-patient-flags-app'
```

## Contributing
Expand All @@ -53,7 +53,7 @@ yarn test

## Deployment

The `main` branch of this repo is deployed in a [demo environment](https://openmrs-spa.org/openmrs/spa).
The `main` branch of this repo is deployed in a [demo](https://data.kenyahmis.org:8500/openmrs/spa).

## Configuration

Expand Down
40 changes: 0 additions & 40 deletions coverage/clover.xml

This file was deleted.

3 changes: 0 additions & 3 deletions coverage/coverage-final.json

This file was deleted.

Loading

0 comments on commit 590924b

Please sign in to comment.