From 6199867c27dfb292e7c3e6f82e8c6df4c150d1fe Mon Sep 17 00:00:00 2001 From: b-yogesh Date: Tue, 26 Nov 2024 12:45:20 +0100 Subject: [PATCH 1/7] Update publish.yml --- .github/workflows/publish.yml | 52 +---------------------------------- 1 file changed, 1 insertion(+), 51 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 279b1860..c9c55413 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,4 +1,4 @@ -name: Package and Publish +name: Package and Publish to PyPi on: release: @@ -77,53 +77,3 @@ jobs: password: ${{ secrets.PYPI_API_TOKEN }} packages_dir: chartlets.py/dist verbose: true - - npm-tests: - runs-on: ubuntu-latest - strategy: - matrix: - node-version: [16.x, 18.x, 20.x] - # See supported Node.js release schedule at - # https://nodejs.org/en/about/releases/ - defaults: - run: - working-directory: chartlets.js - - steps: - - uses: actions/checkout@v3 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - cache: 'npm' - cache-dependency-path: chartlets.js/package-lock.json - - - run: npm ci - - run: npm run lint - - run: npm run build - - run: npm run test - - npm-Deploy: - name: Publish TS-React Package to npmjs - runs-on: ubuntu-latest - needs: npm-tests - defaults: - run: - working-directory: chartlets.js - - steps: - - uses: actions/checkout@v4 - - - name: Set up Node.js - uses: actions/setup-node@v4 - with: - node-version: '18.x' - registry-url: 'https://registry.npmjs.org' - cache: 'npm' - cache-dependency-path: chartlets.js/package-lock.json - - - run: npm ci - - run: npm run build - - run: npm publish --access public - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} From b5f0a19dda12d1e0f623e4c9c3f8ca1a7699fa19 Mon Sep 17 00:00:00 2001 From: b-yogesh Date: Tue, 26 Nov 2024 12:46:47 +0100 Subject: [PATCH 2/7] Rename publish.yml to publish-backend.yml --- .github/workflows/{publish.yml => publish-backend.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{publish.yml => publish-backend.yml} (100%) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish-backend.yml similarity index 100% rename from .github/workflows/publish.yml rename to .github/workflows/publish-backend.yml From 72bf3088198648e95905322f33bd9213875bc016 Mon Sep 17 00:00:00 2001 From: b-yogesh Date: Tue, 26 Nov 2024 12:47:40 +0100 Subject: [PATCH 3/7] Update publish-backend.yml --- .github/workflows/publish-backend.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-backend.yml b/.github/workflows/publish-backend.yml index c9c55413..c5ff451b 100644 --- a/.github/workflows/publish-backend.yml +++ b/.github/workflows/publish-backend.yml @@ -45,7 +45,7 @@ jobs: env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - PyPi-Deploy: + PyPi-deploy: name: Publish Python Package to PyPI runs-on: ubuntu-latest needs: python-tests From fa8431b2ef46e1d03a02f76641dfc6e0ea015bab Mon Sep 17 00:00:00 2001 From: b-yogesh Date: Tue, 26 Nov 2024 12:47:46 +0100 Subject: [PATCH 4/7] Create publish-frontend.yml --- .github/workflows/publish-frontend.yml | 57 ++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/publish-frontend.yml diff --git a/.github/workflows/publish-frontend.yml b/.github/workflows/publish-frontend.yml new file mode 100644 index 00000000..25a0c9b8 --- /dev/null +++ b/.github/workflows/publish-frontend.yml @@ -0,0 +1,57 @@ +name: Package and Publish to NPM + +on: + release: + types: [published] + workflow_dispatch: + +jobs: + npm-tests: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [16.x, 18.x, 20.x] + # See supported Node.js release schedule at + # https://nodejs.org/en/about/releases/ + defaults: + run: + working-directory: chartlets.js + + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + cache-dependency-path: chartlets.js/package-lock.json + + - run: npm ci + - run: npm run lint + - run: npm run build + - run: npm run test + + npm-deploy: + name: Publish TS-React Package to npmjs + runs-on: ubuntu-latest + needs: npm-tests + defaults: + run: + working-directory: chartlets.js + + steps: + - uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '18.x' + registry-url: 'https://registry.npmjs.org' + cache: 'npm' + cache-dependency-path: chartlets.js/package-lock.json + + - run: npm ci + - run: npm run build + - run: npm publish --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} From cf4103c79e6efabffe251483bf11a8fac419f79b Mon Sep 17 00:00:00 2001 From: b-yogesh Date: Mon, 16 Dec 2024 16:30:33 +0100 Subject: [PATCH 5/7] Update publish-backend.yml --- .github/workflows/publish-backend.yml | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/workflows/publish-backend.yml b/.github/workflows/publish-backend.yml index c5ff451b..7fe6a19e 100644 --- a/.github/workflows/publish-backend.yml +++ b/.github/workflows/publish-backend.yml @@ -1,4 +1,4 @@ -name: Package and Publish to PyPi +name: Package and Publish on: release: @@ -36,16 +36,21 @@ jobs: # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - name: Test with pytest + - name: Run unit tests + shell: bash -l {0} run: | - pytest --cov=chartlets - + pytest --cov=chartlets --cov-report=xml + - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v3 - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + uses: codecov/codecov-action@v4 + with: + fail_ci_if_error: true + directory: chartlets.py/ + flags: backend + verbose: true + token: ${{ secrets.CODECOV_TOKEN }} - PyPi-deploy: + PyPi-Deploy: name: Publish Python Package to PyPI runs-on: ubuntu-latest needs: python-tests From 6e84c2f9f19ad1eb4b0dbc8f25129b8743ed383f Mon Sep 17 00:00:00 2001 From: b-yogesh Date: Mon, 16 Dec 2024 16:41:03 +0100 Subject: [PATCH 6/7] Update publish-frontend.yml --- .github/workflows/publish-frontend.yml | 45 +++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish-frontend.yml b/.github/workflows/publish-frontend.yml index 25a0c9b8..769a9d58 100644 --- a/.github/workflows/publish-frontend.yml +++ b/.github/workflows/publish-frontend.yml @@ -6,7 +6,7 @@ on: workflow_dispatch: jobs: - npm-tests: + npm-tests-lib: runs-on: ubuntu-latest strategy: matrix: @@ -15,7 +15,7 @@ jobs: # https://nodejs.org/en/about/releases/ defaults: run: - working-directory: chartlets.js + working-directory: chartlets.js/packages/lib steps: - uses: actions/checkout@v3 @@ -28,16 +28,51 @@ jobs: - run: npm ci - run: npm run lint - - run: npm run build - run: npm run test + + - run: npm run coverage + - name: Upload coverage reports for lib to Codecov + uses: codecov/codecov-action@v4 + with: + fail_ci_if_error: true + directory: coverage/ + flags: frontend + verbose: true + token: ${{ secrets.CODECOV_TOKEN }} + + - run: npm run build + + npm-tests-demo: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [16.x, 18.x, 20.x] + # See supported Node.js release schedule at + # https://nodejs.org/en/about/releases/ + defaults: + run: + working-directory: chartlets.js/packages/demo + + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + cache-dependency-path: chartlets.js/package-lock.json + + - run: npm ci + - run: npm run lint + - run: npm run build npm-deploy: name: Publish TS-React Package to npmjs runs-on: ubuntu-latest - needs: npm-tests + needs: [npm-tests-lib, npm-tests-demo] defaults: run: - working-directory: chartlets.js + working-directory: chartlets.js/packages/lib steps: - uses: actions/checkout@v4 From 15c238e8aedfb2f0f4add7c30d604368e53ae3aa Mon Sep 17 00:00:00 2001 From: b-yogesh Date: Mon, 16 Dec 2024 16:41:48 +0100 Subject: [PATCH 7/7] Update publish-backend.yml --- .github/workflows/publish-backend.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-backend.yml b/.github/workflows/publish-backend.yml index 7fe6a19e..4877d38d 100644 --- a/.github/workflows/publish-backend.yml +++ b/.github/workflows/publish-backend.yml @@ -1,4 +1,4 @@ -name: Package and Publish +name: Package and Publish to PyPi on: release: