Bump date-fns from 2.16.1 to 3.6.0 in /frontend #2513
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
name: Testing | |
on: [pull_request_target] | |
jobs: | |
test-be: | |
name: Backend Tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup CI Script | |
run: bash scripts/setup_ci.sh | |
env: | |
DB_URI: ${{ secrets.TEST_DB_URI }} | |
GOOGLE_CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_ID }} | |
GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_SECRET }} | |
SESSION_SECRET: ${{ secrets.SESSION_SECRET }} | |
- name: Build Backend & Run Tests | |
run: docker-compose run -e CI=true backend npm run test:coverage | |
- name: Generate Coverage Report | |
run: docker-compose run -v "$(pwd)"/backend:/var/temp backend /var/www/app/node_modules/.bin/nyc report --report-dir /var/temp/cover --temp-dir /var/temp/.nyc_output --reporter=lcov --reporter=clover --reporter=json | |
- name: Upload BE Coverage Artifact | |
uses: actions/upload-artifact@v1 | |
with: | |
name: Unit BE Test Coverage Report | |
path: backend/cover/lcov-report | |
- name: Upload BE Coverage to Codecov | |
uses: codecov/codecov-action@v1 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: ./backend/cover/lcov.info | |
name: be-unit-coverage | |
test: | |
name: Cypress Run | |
runs-on: ubuntu-latest | |
# If we want to use a build matrix for parallelism | |
# strategy: | |
# when one test fails, DO NOT cancel the other | |
# containers, because this will kill Cypress processes | |
# leaving the Dashboard hanging ... | |
# https://github.com/cypress-io/github-action/issues/48 | |
# fail-fast: false | |
# matrix: | |
# run 3 copies of the current job in parallel | |
# containers: [1, 2] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Use Node.js 20.x | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 20.x | |
- name: npm installation | |
run: npm ci | |
- name: Setup CI Script | |
run: bash scripts/setup_ci.sh | |
env: | |
DB_URI: ${{ secrets.TEST_DB_URI }} | |
GOOGLE_CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_ID }} | |
GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_SECRET }} | |
SESSION_SECRET: ${{ secrets.SESSION_SECRET }} | |
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} | |
MAPQUEST_KEY: ${{ secrets.MAPQUEST_KEY }} | |
MAPQUEST_URI: ${{ secrets.MAPQUEST_URI }} | |
REACT_APP_MAPBOX_ACCESS_TOKEN: ${{ secrets.REACT_APP_MAPBOX_ACCESS_TOKEN }} | |
REACT_APP_API_URI: ${{ secrets.REACT_APP_API_URI }} | |
FE_URI: ${{ secrets.FE_URI }} | |
- name: Seed Test Database | |
run: docker-compose run backend /bin/bash -c "node utils/generate_mock_data.js 100 false --color" | |
- name: Build Stack | |
run: docker-compose -f docker-compose.cypress.yml build | |
- name: Cypress run | |
uses: cypress-io/github-action@v2 | |
with: | |
record: true | |
# parallel: true | |
working-directory: frontend | |
env: BASE_URI=http://localhost:3000,API_URI=http://localhost:5000 | |
start: docker-compose -f ../docker-compose.cypress.yml up -d | |
wait-on: "http://localhost:3000" | |
wait-on-timeout: 120 | |
env: | |
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# Workaround since everything is run within the context of the Docker container in /var/www/app, | |
# but Cypress is run outside the container, we need to spin up a container in order to generate the report | |
# to get accurate source mappings | |
- name: Generate Full Stack Coverage Report | |
run: bash scripts/get_coverage.sh | |
- name: Upload FE Coverage Artifact | |
uses: actions/upload-artifact@v1 | |
with: | |
name: Cypress FE Test Coverage Report | |
path: frontend/cover/lcov-report | |
- name: Upload BE Coverage Artifact | |
uses: actions/upload-artifact@v1 | |
with: | |
name: Cypress BE Test Coverage Report | |
path: backend/cover/lcov-report | |
- name: Upload FE Coverage to Codecov | |
uses: codecov/codecov-action@v1 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: ./frontend/cover/lcov.info | |
name: fe-cypress-coverage | |
- name: Upload BE Coverage to Codecov | |
uses: codecov/codecov-action@v1 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: ./backend/cover/lcov.info | |
name: be-cypress-coverage | |
# # # Setup tmate for debugging | |
# - name: Setup tmate session | |
# uses: mxschmitt/action-tmate@v1 |