chore: Upgrade to webpack 4.47 (#159) #378
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: | |
push: | |
branches: | |
- master | |
- v1 | |
pull_request: | |
branches: | |
- master | |
- v1 | |
jobs: | |
nightly: | |
name: Check package (Node ${{ matrix.node-version }}) | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
node-version: [16.20.2] | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 1 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install dependencies | |
run: | | |
npm ci | |
- name: Lint | |
run: | | |
npm run lint | |
- name: Test | |
run: | | |
npm test | |
- name: Build | |
run: | | |
npm run build | |
env: | |
CI: true | |
bootstrap: | |
name: Check bootstrapped userscript (Node ${{ matrix.node-version }}) | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
node-version: [16.20.2] | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 1 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Bootstrap userscript | |
# This step is NOT intended to check how any changes to the library/package might affect the bootstrapped userscript. | |
# It only checks changes to the bootstrapped userscript itself. | |
working-directory: ${{ runner.temp }} | |
run: | | |
mkdir bootstrapped-userscript | |
cd $_ | |
npx tiged@2.12.7 https://github.com/${{ github.repository }}/bootstrap#${{ github.sha }} | |
npm ci | |
npm run build | |
userscripts: | |
name: "Dependent: ${{ matrix.repository.humanReadableName }} (Node ${{ matrix.node-version }})" | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
repository: | |
- humanReadableName: Better SweClockers | |
ownerSlashName: SimonAlling/better-sweclockers | |
refInRepo: master | |
pathInRepo: "" | |
- humanReadableName: Example Userscript | |
ownerSlashName: SimonAlling/example-userscript | |
refInRepo: master | |
pathInRepo: "" | |
- humanReadableName: Bootstrapped Userscript | |
ownerSlashName: SimonAlling/userscripter | |
refInRepo: ${{ github.sha }} # The purpose here, unlike in the `bootstrap` job, _is_ to check how any changes to the library/package might affect the bootstrapped userscript. | |
pathInRepo: bootstrap/ | |
node-version: [16.20.2] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 1 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install dependencies | |
run: | | |
npm ci | |
- name: Build | |
run: | | |
npm run build | |
- name: Pack | |
id: pack | |
run: | | |
echo "tarball=$(pwd)/$(npm pack)" >> $GITHUB_OUTPUT | |
- name: Clone userscript | |
uses: actions/checkout@v2 | |
with: | |
repository: ${{ matrix.repository.ownerSlashName }} | |
ref: ${{ matrix.repository.refInRepo }} | |
path: dependent-userscripts/${{ matrix.repository.ownerSlashName }} # Must be relative to github.workspace, apparently. | |
fetch-depth: 1 | |
- name: Move userscript | |
run: | | |
mkdir -p "${TARGET_DIR}" | |
mv --no-target-directory "${{ github.workspace }}/dependent-userscripts/${{ matrix.repository.ownerSlashName }}" "${TARGET_DIR}" | |
env: | |
TARGET_DIR: ${{ runner.temp }}/${{ matrix.repository.ownerSlashName }} | |
- name: Install userscript dependencies | |
working-directory: ${{ runner.temp }}/${{ matrix.repository.ownerSlashName }}/${{ matrix.repository.pathInRepo }} | |
run: | | |
npm ci | |
- name: Install Userscripter | |
working-directory: ${{ runner.temp }}/${{ matrix.repository.ownerSlashName }}/${{ matrix.repository.pathInRepo }} | |
run: | | |
npm install "${{ steps.pack.outputs.tarball }}" | |
- name: Build userscript | |
working-directory: ${{ runner.temp }}/${{ matrix.repository.ownerSlashName }}/${{ matrix.repository.pathInRepo }} | |
run: | | |
npm run build |