Skip to content
This repository has been archived by the owner on Aug 13, 2023. It is now read-only.

fix(deps): update dependency semver to v7.5.2 [security] #4176

fix(deps): update dependency semver to v7.5.2 [security]

fix(deps): update dependency semver to v7.5.2 [security] #4176

name: Psammead CI - Unit Tests & Code Coverage
on:
create:
branches:
- '**'
pull_request:
branches:
- '**'
push:
branches:
- latest
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['12']
env:
CI: true
LOG_LEVEL: 'error'
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
GIT_COMMIT_SHA: ${{ github.sha }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
# Sets the GIT_BRANCH env variable on a push event which occurs when we merge a PR. ${GITHUB_REF##*/} is the shorthand syntax for getting the short branch name
- name: Set GIT_BRANCH Environment Variable For Push Event
if: ${{ github.event_name == 'push' }}
run: echo "GIT_BRANCH=$(echo ${GITHUB_REF##*/})" >> $GITHUB_ENV
# Sets the GIT_BRANCH env variable on a pull request event which occurs when we create/update a PR. ${{ github.head_ref }} is the syntax for getting the short branch name
- name: Set GIT_BRANCH Environment Variable For Pull Request Event
if: ${{ github.event_name == 'pull_request' }}
run: echo "GIT_BRANCH=${{ github.head_ref }}" >> $GITHUB_ENV
- name: Install Node Modules
run: |
echo ${GITHUB_REF##*/}
./scripts/installNodeModules.sh
- name: Setup Code Climate Test Coverage
# Only run if the workflow started from bbc/psammead i.e. not a fork.
if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name == 'bbc/psammead' }}
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
./cc-test-reporter before-build
- name: Unit Tests
run: yarn test:ci
- name: Report Code Climate Test Coverage
# Only run if the workflow started from bbc/psammead i.e. not a fork.
if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name == 'bbc/psammead' }}
run: ./cc-test-reporter after-build -t lcov --debug --exit-code 0