mirror of
https://github.com/aleleba/create-react-ssr.git
synced 2025-01-09 05:26:58 -06:00
PR-335298: updating packages and change the two workflows of github actions to one main workflow.
This commit is contained in:
parent
db2d80c834
commit
841ac4413e
@ -1,9 +1,17 @@
|
|||||||
name: Testing package
|
# This file contains the main workflow for the create-react-ssr project. It defines the steps and actions to be taken when the workflow is triggered.
|
||||||
|
# Name of the workflow
|
||||||
|
name: Main Workflow
|
||||||
|
|
||||||
|
# Define the events that trigger the workflow
|
||||||
on:
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ master ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: ['*']
|
branches: ['*']
|
||||||
|
|
||||||
|
# Define the jobs that run as part of the workflow
|
||||||
jobs:
|
jobs:
|
||||||
|
# Job to run tests
|
||||||
test:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
@ -20,6 +28,8 @@ jobs:
|
|||||||
registry-url: https://registry.npmjs.org/
|
registry-url: https://registry.npmjs.org/
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
- run: npm test
|
- run: npm test
|
||||||
|
|
||||||
|
# Job to run Cypress tests
|
||||||
cypress-run:
|
cypress-run:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
@ -34,6 +44,8 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
build: npm run build
|
build: npm run build
|
||||||
start: npm start
|
start: npm start
|
||||||
|
|
||||||
|
# Job to run Cypress component tests
|
||||||
cypress-run-component:
|
cypress-run-component:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
@ -45,7 +57,10 @@ jobs:
|
|||||||
uses: cypress-io/github-action@v5 # use the explicit version number
|
uses: cypress-io/github-action@v5 # use the explicit version number
|
||||||
with:
|
with:
|
||||||
component: true
|
component: true
|
||||||
|
|
||||||
|
# Job to build the package
|
||||||
test-build-package:
|
test-build-package:
|
||||||
|
if: github.ref != 'refs/heads/master'
|
||||||
needs: [ test, cypress-run, cypress-run-component ]
|
needs: [ test, cypress-run, cypress-run-component ]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
@ -55,4 +70,20 @@ jobs:
|
|||||||
node-version: 16
|
node-version: 16
|
||||||
registry-url: https://registry.npmjs.org/
|
registry-url: https://registry.npmjs.org/
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
- run: npm run build
|
- run: npm run build
|
||||||
|
|
||||||
|
# Job to publish the package to NPM
|
||||||
|
publish-npm:
|
||||||
|
if: github.ref == 'refs/heads/master'
|
||||||
|
needs: [ test, cypress-run, cypress-run-component ]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: 16
|
||||||
|
registry-url: https://registry.npmjs.org/
|
||||||
|
- run: npm ci
|
||||||
|
- run: npm publish --access=public
|
||||||
|
env:
|
||||||
|
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
|
54
.github/workflows/npm-publish.yml
vendored
54
.github/workflows/npm-publish.yml
vendored
@ -1,54 +0,0 @@
|
|||||||
name: NPM testing and publish package
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ master ]
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: 16
|
|
||||||
registry-url: https://registry.npmjs.org/
|
|
||||||
- run: npm ci
|
|
||||||
- run: npm test
|
|
||||||
cypress-run:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
env:
|
|
||||||
PORT: 3000
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
# Install NPM dependencies, cache them correctly
|
|
||||||
# and run all Cypress tests
|
|
||||||
- name: Cypress run
|
|
||||||
uses: cypress-io/github-action@v5 # use the explicit version number
|
|
||||||
with:
|
|
||||||
build: npm run build
|
|
||||||
start: npm start
|
|
||||||
cypress-run-component:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
# Install NPM dependencies, cache them correctly
|
|
||||||
# and run all Cypress tests
|
|
||||||
- name: Cypress run
|
|
||||||
uses: cypress-io/github-action@v5 # use the explicit version number
|
|
||||||
with:
|
|
||||||
component: true
|
|
||||||
publish-npm:
|
|
||||||
needs: [ build, cypress-run, cypress-run-component ]
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: 16
|
|
||||||
registry-url: https://registry.npmjs.org/
|
|
||||||
- run: npm ci
|
|
||||||
- run: npm publish --access=public
|
|
||||||
env:
|
|
||||||
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
|
|
@ -10,7 +10,7 @@ React (Render Library) | 18.2.0
|
|||||||
Redux (Global State Management) | 4.2.1
|
Redux (Global State Management) | 4.2.1
|
||||||
React Router DOM (Routing) | 6.18.0
|
React Router DOM (Routing) | 6.18.0
|
||||||
Jest (Testing) | 29.7.0
|
Jest (Testing) | 29.7.0
|
||||||
Cypress (E2E Testing) | 13.4.0
|
Cypress (E2E Testing) | 13.5.0
|
||||||
Typescript | 5.2.2
|
Typescript | 5.2.2
|
||||||
|
|
||||||
## Setup
|
## Setup
|
||||||
|
1284
package-lock.json
generated
1284
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
12
package.json
12
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@aleleba/create-react-ssr",
|
"name": "@aleleba/create-react-ssr",
|
||||||
"version": "3.9.13",
|
"version": "3.9.14",
|
||||||
"description": "Starter Kit of server side render of react",
|
"description": "Starter Kit of server side render of react",
|
||||||
"bin": "./bin/cli.js",
|
"bin": "./bin/cli.js",
|
||||||
"main": "src/server/index",
|
"main": "src/server/index",
|
||||||
@ -64,10 +64,10 @@
|
|||||||
"workbox-streams": "^7.0.0"
|
"workbox-streams": "^7.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.23.2",
|
"@babel/core": "^7.23.3",
|
||||||
"@babel/preset-env": "^7.23.2",
|
"@babel/preset-env": "^7.23.3",
|
||||||
"@babel/preset-react": "^7.22.15",
|
"@babel/preset-react": "^7.23.3",
|
||||||
"@babel/preset-typescript": "^7.23.2",
|
"@babel/preset-typescript": "^7.23.3",
|
||||||
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.11",
|
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.11",
|
||||||
"@redux-devtools/extension": "^3.2.6",
|
"@redux-devtools/extension": "^3.2.6",
|
||||||
"@testing-library/jest-dom": "^6.1.4",
|
"@testing-library/jest-dom": "^6.1.4",
|
||||||
@ -89,7 +89,7 @@
|
|||||||
"copy-webpack-plugin": "^11.0.0",
|
"copy-webpack-plugin": "^11.0.0",
|
||||||
"css-loader": "^6.8.1",
|
"css-loader": "^6.8.1",
|
||||||
"css-minimizer-webpack-plugin": "^5.0.1",
|
"css-minimizer-webpack-plugin": "^5.0.1",
|
||||||
"cypress": "^13.4.0",
|
"cypress": "^13.5.0",
|
||||||
"eslint": "^8.53.0",
|
"eslint": "^8.53.0",
|
||||||
"eslint-plugin-react": "^7.33.2",
|
"eslint-plugin-react": "^7.33.2",
|
||||||
"eslint-webpack-plugin": "^4.0.1",
|
"eslint-webpack-plugin": "^4.0.1",
|
||||||
|
Loading…
Reference in New Issue
Block a user