Skip to content

Commit e878895

Browse files
committed
Merge branch 'main' of https://github.com/NFDI4Chem/nmrium-react-wrapper into prod-helm-deploy
2 parents 32811c1 + ae56c1e commit e878895

29 files changed

Lines changed: 405232 additions & 10500 deletions

.eslintrc.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@
5656
"import/prefer-default-export":"off",
5757
"react/prop-types":"off",
5858
"react/no-unknown-property": ["error", { "ignore": ["css"] }]
59+
60+
5961

6062

6163
},
@@ -65,5 +67,14 @@
6567

6668
}
6769
}
68-
}
70+
},
71+
"overrides": [
72+
{
73+
"files":["src/*.json"],
74+
"rules":{
75+
"no-unused-expressions": "off"
76+
}
77+
78+
}
79+
]
6980
}

.github/workflows/dev-build.yml

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
# This worklflow will perform following actions when the code is pushed to development branch:
2+
# - Run end to end test.
3+
# - Check Linting.
4+
# - Build the latest docker image in development which needs both e2etest and lint to pass first.
5+
# - Push the latest docker image to Google Artifact Registry-Dev.
6+
# - Rollout the latest image in GKE.
7+
#
8+
# Maintainers:
9+
# - name: Nisha Sharma
10+
# - email: nisha.sharma@uni-jena.de
11+
12+
name : Build and Deploy to Dev
13+
14+
on:
15+
push:
16+
branches: [development]
17+
18+
env:
19+
PROJECT_ID: ${{ secrets.GKE_PROJECT }}
20+
GKE_CLUSTER_DEV: nmrxiv-dev
21+
GKE_ZONE: europe-west3-a
22+
DEPLOYMENT_NAME: nmrxiv-nmrium
23+
REPOSITORY_NAME_DEV: nmrxiv-dev
24+
IMAGE: nmrium
25+
26+
jobs:
27+
e2etest:
28+
runs-on: ubuntu-latest
29+
strategy:
30+
matrix:
31+
project: [chromium, firefox, webkit]
32+
fail-fast: false
33+
steps:
34+
- uses: actions/checkout@v3
35+
- uses: actions/setup-node@v3
36+
with:
37+
node-version: 16.x
38+
- name: Install dependencies
39+
run: npm ci
40+
- name: Install Playwright
41+
run: npx playwright install --with-deps
42+
- name: Build test application
43+
env:
44+
NODE_OPTIONS: '--max_old_space_size=4096'
45+
run: npm run build-no-minify
46+
- name: Run E2E tests on ${{ matrix.project }}
47+
run: npx playwright test --project ${{ matrix.project }}
48+
continue-on-error: ${{ matrix.project == 'webkit' }}
49+
50+
lint:
51+
runs-on: ubuntu-latest
52+
steps:
53+
- uses: actions/checkout@v2
54+
- uses: actions/setup-node@v2
55+
with:
56+
node-version: 16.x
57+
- name: Install dependencies
58+
run: npm ci
59+
- name: Run ESLint
60+
run: npm run eslint
61+
- name: Run Prettier
62+
run: npm run prettier
63+
- name: Check types
64+
run: npm run check-types
65+
66+
setup-build-publish-deploy-dev:
67+
name: Deploy to dev
68+
if: github.ref == 'refs/heads/development'
69+
runs-on: ubuntu-latest
70+
needs: [lint, e2etest]
71+
steps:
72+
- name: Checkout
73+
uses: actions/checkout@v2
74+
75+
# Setup gcloud CLI
76+
- name: Setup CLI
77+
uses: google-github-actions/setup-gcloud@94337306dda8180d967a56932ceb4ddcf01edae7
78+
with:
79+
service_account_key: ${{ secrets.GKE_SA_KEY }}
80+
project_id: ${{ secrets.GKE_PROJECT }}
81+
82+
# Configure docker to use the gcloud command-line tool as a credential helper
83+
- name: Configure docker
84+
run: |-
85+
gcloud auth configure-docker europe-west3-docker.pkg.dev
86+
87+
# Get the GKE credentials so we can deploy to the cluster
88+
- name: Get GKE credentials
89+
uses: google-github-actions/get-gke-credentials@v0.3.0
90+
with:
91+
cluster_name: ${{ env.GKE_CLUSTER_DEV }}
92+
location: ${{ env.GKE_ZONE }}
93+
credentials: ${{ secrets.GKE_SA_KEY }}
94+
95+
# Build the Docker image
96+
- name: Build docker image
97+
run: |-
98+
docker build -f Dockerfile.prod --tag europe-west3-docker.pkg.dev/$PROJECT_ID/$REPOSITORY_NAME_DEV/$IMAGE:latest .
99+
100+
# Push the Docker image to Google Artifact Registry
101+
- name: Publish image to Google Artifact Registry
102+
run: |-
103+
docker push "europe-west3-docker.pkg.dev/$PROJECT_ID/$REPOSITORY_NAME_DEV/$IMAGE:latest"
104+
105+
# Deploy the latest Docker image to the GKE cluster
106+
- name: Deploy
107+
run: |-
108+
kubectl rollout restart deployment/$DEPLOYMENT_NAME
109+
kubectl rollout status deployment/$DEPLOYMENT_NAME --timeout=300s
110+
kubectl get services -o wide

.github/workflows/e2e.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: E2E tests
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
e2e:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
project: [chromium, firefox, webkit]
13+
fail-fast: false
14+
steps:
15+
- uses: actions/checkout@v3
16+
- uses: actions/setup-node@v3
17+
with:
18+
node-version: 18.x
19+
- name: Install dependencies
20+
run: npm ci
21+
- name: Install Playwright
22+
run: npx playwright install --with-deps
23+
- name: Build test application
24+
run: npm run build-no-minify
25+
- name: Run E2E tests on ${{ matrix.project }}
26+
run: npx playwright test --project ${{ matrix.project }}
27+
continue-on-error: ${{ matrix.project == 'webkit' }}
28+
- name: Upload test results
29+
if: always()
30+
uses: actions/upload-artifact@v3
31+
with:
32+
name: test-results-${{ matrix.project }}
33+
path: test-results
34+

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Changelog
2+
3+
## [0.2.0](https://github.com/NFDI4Chem/nmrium-react-wrapper/compare/v0.1.0...v0.2.0) (2023-03-30)
4+
5+
6+
### Features
7+
8+
* upgrade NMRium to version 0.34.0 ([#71](https://github.com/NFDI4Chem/nmrium-react-wrapper/issues/71)) ([24f1caa](https://github.com/NFDI4Chem/nmrium-react-wrapper/commit/24f1caa731a01246a0338357d46d62fabfcf0860))
9+
10+
11+
### Bug Fixes
12+
13+
* rename build workflow ([1977a3f](https://github.com/NFDI4Chem/nmrium-react-wrapper/commit/1977a3fc37dea75f79f692b5ff6a6af75e940851))

0 commit comments

Comments
 (0)