-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from DynamoDS/GithubAction
Initial corrections and add action
- Loading branch information
Showing
22 changed files
with
7,643 additions
and
1,911 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | ||
|
||
name: PR Build | ||
|
||
on: | ||
push: | ||
pull_request: | ||
branches: ["master"] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [20.x] | ||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | ||
|
||
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" | ||
- name: Install dependencies | ||
run: npm ci --force | ||
- name: Build | ||
run: npm run build --if-present | ||
- name: Unit Tests | ||
run: npm run test:unit | ||
- name: Install Browser | ||
run: npx playwright install chromium --with-deps | ||
- name: E2E tests | ||
run: npm run test:e2e | ||
- name: Code Coverage Report | ||
uses: zgosalvez/github-actions-report-lcov@v1 | ||
with: | ||
coverage-files: coverage/lcov.info | ||
# minimum-coverage: 50 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages | ||
|
||
name: Publish release | ||
|
||
on: | ||
# uncomment the following if you need to debug manual trigger | ||
# workflow_dispatch: | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
# Build dev first | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
- name: Install dependencies | ||
run: npm ci --force | ||
- name: Build for development | ||
run: npm run build --if-present | ||
- name: Run Test | ||
run: npm run test:unit | ||
|
||
# Build prod bundle and publish publicly | ||
publish-npm: | ||
needs: 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/ | ||
- name: Install dependencies | ||
run: npm ci --force | ||
- name: Build for production | ||
run: npm run production --if-present | ||
- name: Run Test | ||
run: npm run test:unit | ||
env: | ||
# Set environment to production just in case | ||
NODE_ENV: production | ||
- name: The final publish step within dist folder | ||
working-directory: dist | ||
# This will publish the package and set access to public as if you had run npm access public after publishing. | ||
run: npm publish --access public | ||
env: | ||
# Get npm token from Github | ||
NODE_AUTH_TOKEN: ${{secrets.npm_token}} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2023 DynamoDS | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* For a detailed explanation regarding each configuration property, visit: | ||
* https://jestjs.io/docs/configuration | ||
*/ | ||
|
||
module.exports = { | ||
moduleNameMapper: { | ||
'\\.(jpg|jpeg|png|gif)$': '<rootDir>/tests/__mocks__/fileMock.js', | ||
'\\.(css|less)$': '<rootDir>/tests/__mocks__/styleMock.js', | ||
'\\.(css|less)$': '<rootDir>/tests/__mocks__/chromeMock.js', | ||
}, | ||
testEnvironment: 'jsdom', | ||
collectCoverage: true, | ||
collectCoverageFrom: ['<rootDir>/src/**/*.{js,jsx}'], | ||
coverageDirectory: '<rootDir>/coverage', | ||
coverageReporters: ['text', 'lcov'], | ||
setupFilesAfterEnv: ['<rootDir>/tests/jest.setup.js'], | ||
}; | ||
|
Oops, something went wrong.