Setup nix dev shell #87
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: 'CI' | |
on: | |
pull_request: | |
push: | |
branches: | |
- canary | |
- main | |
jobs: | |
build-audit-test: | |
name: Build & Test all packages on ${{ matrix.os }}, Node ${{ matrix.node }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
# Test all packages with: | |
# 1. Maintenance LTS | |
# 2. Active LTS | |
# 3. Current (i.e. the latest Node.js version available) | |
# https://nodejs.org/en/about/releases/ | |
node: ['lts/gallium', 'lts/hydrogen', 'current'] | |
eleventy: ['2.0.0'] | |
steps: | |
- name: ποΈ Checkout repo | |
uses: actions/checkout@v3 | |
- name: βοΈ Set up Node.js ${{ matrix.node }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node }} | |
- name: β¬οΈ Install dependencies | |
run: npm ci | |
- name: β¬οΈ Install Eleventy ${{ matrix.eleventy }} | |
run: npm install @11ty/eleventy@${{ matrix.eleventy }} | |
- name: π‘οΈ Audit dependencies (audit-level high) | |
# https://docs.npmjs.com/cli/v8/commands/npm-audit#audit-level | |
run: npm audit --audit-level high | |
- name: π‘οΈ Audit dependencies (audit-level moderate) | |
continue-on-error: true | |
run: npm audit --audit-level moderate | |
- name: π¦ Build all libraries | |
run: npm run build:libs | |
- name: π Test @jackdbd/eleventy-plugin-content-security-policy | |
run: npm run test:ci -w packages/eleventy-plugin-content-security-policy | |
- name: π Test @jackdbd/eleventy-plugin-ensure-env-vars | |
env: | |
NODE_ENV: test | |
run: npm run test:ci -w packages/eleventy-plugin-ensure-env-vars | |
- name: π Test @jackdbd/eleventy-plugin-permissions-policy | |
run: npm run test:ci -w packages/eleventy-plugin-permissions-policy | |
- name: π Test @jackdbd/eleventy-plugin-telegram | |
env: | |
TELEGRAM: ${{ secrets.TELEGRAM }} | |
run: npm run test:ci -w packages/eleventy-plugin-telegram | |
- name: π Test @jackdbd/eleventy-plugin-text-to-speech | |
env: | |
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }} | |
TELEGRAM: ${{ secrets.TELEGRAM }} | |
run: npm run test:ci -w packages/eleventy-plugin-text-to-speech | |
- name: β¬οΈ Upload test coverage to Codecov | |
# https://github.com/marketplace/actions/codecov | |
uses: codecov/codecov-action@v3 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
with: | |
# fail_ci_if_error: false | |
fail_ci_if_error: true | |
verbose: true |