add GitHub Action to run unit tests on every PR/push

This commit is contained in:
AmruthPillai 2021-01-23 19:28:01 +05:30
parent 6c31d3dff3
commit b76fa1dcc5
6 changed files with 885 additions and 782 deletions

View File

@ -2,10 +2,9 @@ name: CodeQL Analysis
on:
push:
branches: [ develop ]
branches: [ $default-branch ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ develop ]
branches: [ $default-branch ]
schedule:
- cron: '37 16 * * 0'
@ -18,39 +17,18 @@ jobs:
fail-fast: false
matrix:
language: [ 'javascript' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
steps:
- name: Checkout repository
uses: actions/checkout@v2
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
# Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
#- run: |
# make bootstrap
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1

27
.github/workflows/run-tests.yml vendored Normal file
View File

@ -0,0 +1,27 @@
name: Run Unit Tests
on:
push:
branches: [ $default-branch ]
pull_request:
branches: [ $default-branch ]
jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x, 14.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm test

View File

@ -287,9 +287,9 @@
}
},
"@types/express-serve-static-core": {
"version": "4.17.15",
"resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.15.tgz",
"integrity": "sha512-pb71P0BrBAx7cQE+/7QnA1HTQUkdBKMlkPY7lHUMn0YvPJkL2UA+KW3BdWQ309IT+i9En/qm45ZxpjIcpgEhNQ==",
"version": "4.17.18",
"resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.18.tgz",
"integrity": "sha512-m4JTwx5RUBNZvky/JJ8swEJPKFd8si08pPF2PfizYjGZOKr/svUWPcoUmLow6MmPzhasphB7gSTINY67xn3JNA==",
"requires": {
"@types/node": "*",
"@types/qs": "*",
@ -309,9 +309,9 @@
"optional": true
},
"@types/mime": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/@types/mime/-/mime-2.0.3.tgz",
"integrity": "sha512-Jus9s4CDbqwocc5pOAnh8ShfrnMcPHuJYzVcSUU7lrh8Ni5HuIqX3oilL86p3dlTrk0LzHRCgA/GQ7uNCw6l2Q=="
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.2.tgz",
"integrity": "sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw=="
},
"@types/node": {
"version": "10.17.48",
@ -329,11 +329,11 @@
"integrity": "sha512-ewFXqrQHlFsgc09MK5jP5iR7vumV/BYayNC6PgJO2LPe8vrnNFyjQjSppfEngITi0qvfKtzFvgKymGheFM9UOA=="
},
"@types/serve-static": {
"version": "1.13.8",
"resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.8.tgz",
"integrity": "sha512-MoJhSQreaVoL+/hurAZzIm8wafFR6ajiTM1m4A0kv6AGeVBl4r4pOV8bGFrjjq1sGxDTnCoF8i22o0/aE5XCyA==",
"version": "1.13.9",
"resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.9.tgz",
"integrity": "sha512-ZFqF6qa48XsPdjXV5Gsz0Zqmux2PerNd3a/ktL45mHpa19cuMi/cL8tcxdAx497yRh+QtYPuofjT9oWw9P7nkA==",
"requires": {
"@types/mime": "*",
"@types/mime": "^1",
"@types/node": "*"
}
},
@ -884,9 +884,9 @@
}
},
"firebase-functions": {
"version": "3.13.0",
"resolved": "https://registry.npmjs.org/firebase-functions/-/firebase-functions-3.13.0.tgz",
"integrity": "sha512-tnltJL5KlGtbeBD9scsVjoKTSTMeo6EAy1gsdOfRlrwAu6idgLRKYVdmw0YymS8N7SwJ3CXo+3fuvSSihKhXbA==",
"version": "3.13.1",
"resolved": "https://registry.npmjs.org/firebase-functions/-/firebase-functions-3.13.1.tgz",
"integrity": "sha512-tmYHN9OWWIij/8xO72AD2sKHm9T8pdLPYXy5RWk9VidP8+LDOUZ68vq1g1WKeSkRR7WyVYQ3scU2QoMDfe9T8g==",
"requires": {
"@types/express": "4.17.3",
"cors": "^2.8.5",

View File

@ -13,7 +13,7 @@
},
"dependencies": {
"firebase-admin": "^9.4.2",
"firebase-functions": "^3.13.0",
"firebase-functions": "^3.13.1",
"puppeteer": "5.5.0"
},
"devDependencies": {

1544
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -21,33 +21,33 @@
"@reach/router": "^1.3.4",
"animate.css": "^4.1.1",
"array-move": "^3.0.1",
"autoprefixer": "^10.2.1",
"autoprefixer": "^10.2.3",
"classnames": "^2.2.6",
"dayjs": "^1.10.2",
"dayjs": "^1.10.4",
"dotenv": "^8.2.0",
"downloadjs": "^1.4.7",
"firebase": "^8.2.2",
"firebase": "^8.2.4",
"formik": "^2.2.6",
"gatsby": "^2.30.1",
"gatsby-image": "^2.9.0",
"gatsby-plugin-create-client-paths": "^2.8.0",
"gatsby": "^2.31.1",
"gatsby-image": "^2.10.0",
"gatsby-plugin-create-client-paths": "^2.9.0",
"gatsby-plugin-firebase": "^0.2.0-beta.4",
"gatsby-plugin-manifest": "^2.10.0",
"gatsby-plugin-manifest": "^2.11.0",
"gatsby-plugin-material-ui": "^2.1.10",
"gatsby-plugin-offline": "^3.8.0",
"gatsby-plugin-postcss": "^3.5.0",
"gatsby-plugin-react-helmet": "^3.8.0",
"gatsby-plugin-sharp": "^2.12.0",
"gatsby-plugin-sitemap": "^2.10.0",
"gatsby-plugin-offline": "^3.9.0",
"gatsby-plugin-postcss": "^3.6.0",
"gatsby-plugin-react-helmet": "^3.9.0",
"gatsby-plugin-sharp": "^2.13.1",
"gatsby-plugin-sitemap": "^2.11.0",
"gatsby-plugin-webfonts": "^1.1.4",
"gatsby-source-filesystem": "^2.9.0",
"gatsby-source-filesystem": "^2.10.0",
"gatsby-source-gravatar": "^1.0.0",
"gatsby-transformer-remark": "^2.14.0",
"gatsby-transformer-sharp": "^2.10.0",
"gatsby-transformer-remark": "^2.15.0",
"gatsby-transformer-sharp": "^2.11.0",
"i18next": "^19.8.4",
"lodash": "^4.17.20",
"nanoevents": "^5.1.10",
"postcss": "^8.2.3",
"postcss": "^8.2.4",
"react": "^17.0.1",
"react-beautiful-dnd": "^13.0.0",
"react-dom": "^17.0.1",
@ -62,13 +62,13 @@
"yup": "^0.32.8"
},
"devDependencies": {
"@testing-library/jest-dom": "^5.11.8",
"@testing-library/jest-dom": "^5.11.9",
"@testing-library/react": "^11.2.3",
"babel-jest": "^26.6.3",
"babel-preset-gatsby": "^0.10.0",
"eslint": "^7.17.0",
"babel-preset-gatsby": "^0.11.0",
"eslint": "^7.18.0",
"eslint-config-airbnb": "^18.2.1",
"eslint-config-prettier": "^7.1.0",
"eslint-config-prettier": "^7.2.0",
"eslint-loader": "^4.0.2",
"eslint-plugin-jest": "^24.1.3",
"eslint-plugin-jsx-a11y": "^6.4.1",
@ -78,7 +78,7 @@
"identity-obj-proxy": "^3.0.0",
"jest": "^26.6.3",
"prettier": "2.2.1",
"stylelint": "^13.8.0",
"stylelint": "^13.9.0",
"stylelint-config-standard": "^20.0.0",
"tailwindcss": "^2.0.2"
},