Node.js CI #34
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
# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node | |
name: Node.js CI | |
on: | |
push: | |
paths-ignore: | |
- 'README.md' | |
- '.github/**' | |
- '.dockerignore' | |
- 'docker-compose.yml' | |
- 'Dockerfile' | |
branches: | |
- main | |
pull_request: | |
paths-ignore: | |
- 'README.md' | |
- '.github/**' | |
- '.dockerignore' | |
- 'docker-compose.yml' | |
- 'Dockerfile' | |
branches: | |
- main | |
schedule: | |
# execute once every monday | |
- cron: "0 0 * * MON" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Install Node v16 | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 16 | |
- uses: pnpm/action-setup@v2 | |
name: Install pnpm | |
id: pnpm-install | |
with: | |
version: 7 | |
run_install: false | |
- name: Get pnpm store directory | |
id: pnpm-cache | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v3 | |
name: Setup pnpm cache | |
with: | |
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- name: Install dependencies | |
run: pnpm install | |
analyze: | |
name: Analyze | |
runs-on: ubuntu-latest | |
permissions: | |
actions: read | |
contents: read | |
security-events: write | |
strategy: | |
fail-fast: false | |
matrix: | |
language: ["javascript"] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Initialize CodeQL | |
uses: github/codeql-action/init@v1 | |
with: | |
languages: ${{ matrix.language }} | |
- name: Autobuild | |
uses: github/codeql-action/autobuild@v1 | |
- name: Perform CodeQL Analysis | |
uses: github/codeql-action/analyze@v1 |