Lint-Build-Test #1337
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: Lint-Build-Test | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
schedule: | |
- cron: '0 0 * * *' | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
# Based on: https://docs.github.com/en/actions/configuring-and-managing-workflows/caching-dependencies-to-speed-up-workflows#example-using-the-cache-action | |
- name: Cache node modules | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-node-modules | |
with: | |
# npm cache files are stored in `~/.npm` on Linux/macOS | |
path: ~/.npm | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: Install dependencies | |
run: npm ci | |
- name: Lint | |
run: npm run lint | |
- name: Build | |
run: npm run build -- --configuration=production | |
# See https://github.com/jeroenheijmans/sample-angular-oauth2-oidc-with-auth-guards/issues/57 | |
- name: Update Chrome | |
run: | | |
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - | |
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list' | |
sudo apt-get update | |
sudo apt-get --only-upgrade install google-chrome-stable | |
- name: Unit Tests | |
run: npm run test:ci | |
- name: E2E Tests | |
run: npm run e2e -- --configuration=ci | |
- name: Failure notifications | |
if: ${{ failure() }} | |
uses: rtCamp/[email protected] | |
env: | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
SLACK_USERNAME: ${{github.repository}} | |
SLACK_FOOTER: null | |
SLACK_COLOR: '#d0380b' | |
SLACK_TITLE: 'CI Failure' | |
SLACK_MESSAGE: ':no_entry: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}' | |
MSG_MINIMAL: true |