ava/.github/workflows/ci.yml
Mark Wubben 48dcafa2b8
Update dependencies; more type tweaks
* Upgrade to TypeScript 4.8. Keep testing with 4.7 to ensure backwards compatibility.
* Update dev dependencies
* Update dependencies
* Tweak type definitions used in exports map for TS 4.8 compatibility. Duplicate and export shared types where appropriate, but don't export from the other export file since it seems to confuse things.
2022-09-25 17:06:16 +02:00

108 lines
3 KiB
YAML

name: Install and test AVA
on:
push:
branches:
- main
pull_request:
paths-ignore:
- "*.md"
- "docs/**"
- "media/**"
jobs:
nodejs:
name: Node.js
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
node-version: [^14.19, ^16.15, ^18]
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v3
- name: Enable symlinks
if: matrix.os == 'windows-latest'
run: |
git config core.symlinks true
git reset --hard
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: npm
- name: Upgrade npm
run: npm install --global npm@^8.18
- run: npm install --no-audit
- run: npm run cover
- uses: codecov/codecov-action@v2
with:
files: coverage/lcov.info
name: ${{ matrix.os }}/${{ matrix.node-version }}
typescript:
name: TypeScript compatibility
runs-on: ubuntu-latest
strategy:
matrix:
ts-version: [~4.7, ~4.8]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ^18
cache: npm
- name: Upgrade npm
run: npm install --global npm@^8.18
- run: npm install --no-audit
- run: npm i typescript@${TS_VERSION}
env:
TS_VERSION: ${{ matrix.ts-version }}
- run: ./node_modules/typescript/bin/tsc --version
- run: ./node_modules/typescript/bin/tsc --noEmit
lockfile_churn:
name: Test package-lock for unexpected modifications
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ^18
cache: npm
- name: Upgrade npm
run: if [[ "$(npm -v)" != "8.18.0" ]]; then npm install --global npm@8.18.0; fi
- run: npm install --no-audit
- name: Test package-lock for unexpected modifications
run: |
npm -v
checksum=$(sha512sum package-lock.json)
npm install --package-lock-only --no-audit
if ! echo ${checksum} | sha512sum --quiet -c -; then
echo "package-lock.json was modified unexpectedly. Please rebuild it using npm@$(npm -v) and commit the changes."
exit 1
fi
without_lockfile:
name: Install dependencies without using a lockfile
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ^18
- name: Upgrade npm
run: npm install --global npm@^8.18
- run: npm install --no-package-lock --no-audit
- run: npm run cover
xo:
name: Lint source files
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ^18
cache: npm
- name: Upgrade npm
run: npm install --global npm@^8.18
- run: npm install --no-audit
- run: npx xo