Bump actions/setup-node from 4 to 6 #417
This file contains hidden or 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: "Backend tests" | |
# any branch is useful for testing before a PR is submitted | |
on: [push, pull_request] | |
jobs: | |
withplugins: | |
# run on pushes to any branch | |
# run on PRs from external forks | |
if: | | |
(github.event_name != 'pull_request') | |
|| (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id) | |
name: with Plugins | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Install etherpad core | |
uses: actions/checkout@v5 | |
with: | |
repository: ether/etherpad-lite | |
path: ./etherpad | |
- | |
name: Checkout plugin repository | |
uses: actions/checkout@v5 | |
with: | |
path: ./plugin | |
- | |
uses: actions/setup-node@v6 | |
with: | |
node-version: 20 | |
- uses: pnpm/action-setup@v4 | |
name: Install pnpm | |
with: | |
version: 10 | |
run_install: false | |
- name: Get pnpm store directory | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
- uses: actions/cache@v4 | |
name: Setup pnpm cache | |
with: | |
path: ${{ env.STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- | |
name: Prepare Etherpad core | |
run: | | |
cd ./etherpad | |
./bin/installDeps.sh | |
pnpm link --global | |
- | |
name: Prepare plugin | |
run: | | |
pnpm config set auto-install-peers false | |
cd ./plugin | |
PLUGIN_NAME=$(npx -c 'printf %s\\n "${npm_package_name}"') || exit 1 | |
pnpm install | |
pnpm link --global | |
- name: Link plugin to Etherpad | |
run: | | |
cd ./etherpad/src | |
pnpm link etherpad-cli-client | |
- | |
name: Remove core tests so only the client is tested | |
run: rm -rf ./etherpad/src/tests/backend/specs | |
- | |
name: Run the backend tests | |
run: cd ./etherpad && pnpm run test |