Skip to content

Commit acb9881

Browse files
committed
Merge branch 'main' of https://github.com/NFDI4Chem/nmrium-react-wrapper into prod-helm-deploy
2 parents c80f38d + a4f3a90 commit acb9881

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+15650
-10892
lines changed

.eslintignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
dist
22
node_modules
3-
public
3+
public
4+
build
5+
src/*.json
6+
vite.config.*
7+
lib

.eslintrc.json

Lines changed: 0 additions & 80 deletions
This file was deleted.

.eslintrc.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
root: true
2+
extends:
3+
- cheminfo-react/base
4+
- cheminfo-typescript/base
5+
- cheminfo-typescript/unicorn
6+
rules:
7+
'import/default': off
8+
'import/no-unresolved': off
9+
'react-refresh/only-export-components': off
10+
'@typescript-eslint/naming-convention': off
11+
'@typescript-eslint/restrict-plus-operands': off
12+
'react/no-unstable-nested-components': off
13+
no-restricted-imports:
14+
- error
15+
- name: '@simbathesailor/use-what-changed'
16+
message: 'Remove use-what-changed before committing the code'
17+
react/no-unknown-property:
18+
- error
19+
- ignore:
20+
- 'css'
21+
parserOptions:
22+
sourceType: module

.github/workflows/dev-build.yml

Lines changed: 23 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -20,52 +20,17 @@ env:
2020
GKE_CLUSTER_DEV: nmrxiv-dev
2121
GKE_ZONE: europe-west3-a
2222
DEPLOYMENT_NAME: nmrxiv-nmrium
23-
REPOSITORY_NAME_DEV: nmrxiv-dev
24-
IMAGE: nmrium
23+
DOCKER_HUB_USERNAME : ${{ secrets.DOCKER_HUB_USERNAME }}
24+
DOCKER_HUB_PASSWORD : ${{ secrets.DOCKER_HUB_PASSWORD }}
25+
REPOSITORY_NAME: nmrium-react-wrapper
26+
REPOSITORY_NAMESPACE: nfdi4chem
2527

2628
jobs:
2729
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: 18.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-
run: npm run build-no-minify
44-
- name: Run E2E tests on ${{ matrix.project }}
45-
run: npx playwright test --project ${{ matrix.project }}
46-
continue-on-error: ${{ matrix.project == 'webkit' }}
47-
- name: Upload test results
48-
if: always()
49-
uses: actions/upload-artifact@v3
50-
with:
51-
name: test-results-${{ matrix.project }}
52-
path: test-results
30+
uses: NFDI4Chem/nmrium-react-wrapper/.github/workflows/e2e.yml@main
5331

5432
lint:
55-
runs-on: ubuntu-latest
56-
steps:
57-
- uses: actions/checkout@v2
58-
- uses: actions/setup-node@v2
59-
with:
60-
node-version: 16.x
61-
- name: Install dependencies
62-
run: npm ci
63-
- name: Run ESLint
64-
run: npm run eslint
65-
- name: Run Prettier
66-
run: npm run prettier
67-
- name: Check types
68-
run: npm run check-types
33+
uses: NFDI4Chem/nmrium-react-wrapper/.github/workflows/nodejs.yml@main
6934

7035
setup-build-publish-deploy-dev:
7136
name: Deploy to dev
@@ -74,7 +39,12 @@ jobs:
7439
needs: [lint, e2etest]
7540
steps:
7641
- name: Checkout
77-
uses: actions/checkout@v2
42+
uses: actions/checkout@v3
43+
44+
- name: Update version number
45+
run: |
46+
VERSION=${GITHUB_REF//*\/}
47+
echo "export default { version: '$VERSION' };" > src/versionInfo.ts
7848
7949
# Setup gcloud CLI
8050
- name: Setup CLI
@@ -83,11 +53,6 @@ jobs:
8353
service_account_key: ${{ secrets.GKE_SA_KEY }}
8454
project_id: ${{ secrets.GKE_PROJECT }}
8555

86-
# Configure docker to use the gcloud command-line tool as a credential helper
87-
- name: Configure docker
88-
run: |-
89-
gcloud auth configure-docker europe-west3-docker.pkg.dev
90-
9156
# Get the GKE credentials so we can deploy to the cluster
9257
- name: Get GKE credentials
9358
uses: google-github-actions/[email protected]
@@ -102,15 +67,17 @@ jobs:
10267
username: ${{ env.DOCKER_HUB_USERNAME }}
10368
password: ${{ env.DOCKER_HUB_PASSWORD }}
10469

105-
# Build the Docker image
106-
- name: Build docker image
107-
run: |-
108-
docker build -f Dockerfile.prod --tag europe-west3-docker.pkg.dev/$PROJECT_ID/$REPOSITORY_NAME_DEV/$IMAGE:latest .
109-
110-
# Push the Docker image to Google Artifact Registry
111-
- name: Publish image to Google Artifact Registry
112-
run: |-
113-
docker push "europe-west3-docker.pkg.dev/$PROJECT_ID/$REPOSITORY_NAME_DEV/$IMAGE:latest"
70+
- name: Build and push Docker image
71+
uses: docker/build-push-action@v4
72+
with:
73+
context: .
74+
file: ./Dockerfile.prod
75+
push: true
76+
build-args: |
77+
RELEASE_VERSION=dev-latest
78+
tags: ${{ env.REPOSITORY_NAMESPACE }}/${{ env.REPOSITORY_NAME }}:dev-latest
79+
username: ${{ env.DOCKER_HUB_USERNAME }}
80+
password: ${{ env.DOCKER_HUB_PASSWORD }}
11481

11582
# Deploy the latest Docker image to the GKE cluster
11683
- name: Deploy

.github/workflows/dev-check.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Node.js Dev Checking
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- development
7+
8+
jobs:
9+
e2etest:
10+
uses: NFDI4Chem/nmrium-react-wrapper/.github/workflows/e2e.yml@main
11+
lint:
12+
uses: NFDI4Chem/nmrium-react-wrapper/.github/workflows/nodejs.yml@main
13+

.github/workflows/e2e.yml

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

.github/workflows/nodejs.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Node.js check
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
nodejs:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v3
11+
- uses: actions/setup-node@v3
12+
with:
13+
node-version: 18.x
14+
- name: Install dependencies
15+
run: npm ci
16+
- name: Run ESLint
17+
run: npm run eslint
18+
- name: Run Prettier
19+
run: npm run prettier
20+
- name: Check types
21+
run: npm run check-types

.github/workflows/prod-build.yml

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -69,28 +69,6 @@ jobs:
6969
run: |
7070
echo "tag_name: ${{ steps.fetch-latest-release.outputs.tag_name }}"
7171
72-
# Build the Docker image
73-
- name: Build docker image
74-
run: |-
75-
if [ ${{ steps.fetch-latest-release.outputs.tag_name }} ]; then
76-
docker build --build-arg RELEASE_VERSION=${{ steps.fetch-latest-release.outputs.tag_name }} -f Dockerfile.prod --tag europe-west3-docker.pkg.dev/$PROJECT_ID/$REPOSITORY_NAME_PROD/$IMAGE:latest .
77-
else
78-
echo "Skipping build as no release available.";
79-
fi
80-
81-
# Push the Docker image to Google Artifact Registry
82-
- name: Publish image to Google Artifact Registry
83-
if: ${{ steps.fetch-latest-release.outputs.tag_name }}
84-
run: |-
85-
docker push "europe-west3-docker.pkg.dev/$PROJECT_ID/$REPOSITORY_NAME_PROD/$IMAGE:latest"
86-
87-
#Login to Docker Hub
88-
- name: Log in to Docker Hub
89-
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
90-
with:
91-
username: ${{ env.DOCKER_HUB_USERNAME }}
92-
password: ${{ env.DOCKER_HUB_PASSWORD }}
93-
9472
#Build and push Docker image to Docker Hub
9573
- name: Build and push Docker image
9674
uses: docker/build-push-action@v4
@@ -100,7 +78,7 @@ jobs:
10078
push: true
10179
build-args: |
10280
RELEASE_VERSION=${{ steps.fetch-latest-release.outputs.tag_name }}
103-
tags: ${{ env.REPOSITORY_NAMESPACE }}/${{ env.REPOSITORY_NAME }}:${{ steps.fetch-latest-release.outputs.tag_name }}
81+
tags: ${{ env.REPOSITORY_NAMESPACE }}/${{ env.REPOSITORY_NAME }}:${{ steps.fetch-latest-release.outputs.tag_name }}, ${{ env.REPOSITORY_NAMESPACE }}/${{ env.REPOSITORY_NAME }}:latest
10482
username: ${{ env.DOCKER_HUB_USERNAME }}
10583
password: ${{ env.DOCKER_HUB_PASSWORD }}
10684

.github/workflows/release-please.yml

Lines changed: 2 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -17,47 +17,10 @@ on:
1717

1818
jobs:
1919
e2etest:
20-
runs-on: ubuntu-latest
21-
strategy:
22-
matrix:
23-
project: [chromium, firefox, webkit]
24-
fail-fast: false
25-
steps:
26-
- uses: actions/checkout@v3
27-
- uses: actions/setup-node@v3
28-
with:
29-
node-version: 18.x
30-
- name: Install dependencies
31-
run: npm ci
32-
- name: Install Playwright
33-
run: npx playwright install --with-deps
34-
- name: Build test application
35-
run: npm run build-no-minify
36-
- name: Run E2E tests on ${{ matrix.project }}
37-
run: npx playwright test --project ${{ matrix.project }}
38-
continue-on-error: ${{ matrix.project == 'webkit' }}
39-
- name: Upload test results
40-
if: always()
41-
uses: actions/upload-artifact@v3
42-
with:
43-
name: test-results-${{ matrix.project }}
44-
path: test-results
20+
uses: NFDI4Chem/nmrium-react-wrapper/.github/workflows/e2e.yml@main
4521

4622
lint:
47-
runs-on: ubuntu-latest
48-
steps:
49-
- uses: actions/checkout@v2
50-
- uses: actions/setup-node@v2
51-
with:
52-
node-version: 16.x
53-
- name: Install dependencies
54-
run: npm ci
55-
- name: Run ESLint
56-
run: npm run eslint
57-
- name: Run Prettier
58-
run: npm run prettier
59-
- name: Check types
60-
run: npm run check-types
23+
uses: NFDI4Chem/nmrium-react-wrapper/.github/workflows/nodejs.yml@main
6124

6225
release-please:
6326
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)