Skip to content

Update tests poker #3750

Update tests poker

Update tests poker #3750

Workflow file for this run

# This workflow will do a clean install of node dependencies and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: javascript / pr
on: pull_request
jobs:
precheck:
runs-on: ubuntu-24.04
steps:
- name: Checkout PR
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
with:
fetch-depth: ${{ github.event_name == 'pull_request' && 2 || 0 }}
- name: Get changed files
id: changed-files
run: |
if ${{ github.event_name == 'pull_request' }}; then
echo "changed_files=$(git diff --name-only --diff-filter=ACM -r HEAD^1 HEAD | xargs)" >> $GITHUB_OUTPUT
else
echo "changed_files=$(git diff --name-only --diff-filter=ACM ${{ github.event.before }} ${{ github.event.after }} | xargs)" >> $GITHUB_OUTPUT
fi
- name: Enable corepack to fix https://github.com/actions/setup-node/pull/901
run: corepack enable pnpm
- name: Use Node.js LTS (22.x)
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
with:
node-version: 22.x
cache: 'pnpm'
- name: Install project dependencies
run: corepack pnpm install --frozen-lockfile
- name: Run exercism/javascript ci precheck (stub files, config integrity) for changed exercises
run: corepack pnpm node scripts/pr.mjs ${{ steps.changed-files.outputs.changed_files }}
ci:
runs-on: ubuntu-24.04
strategy:
matrix:
node-version: [22.x]
steps:
- name: Checkout PR
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
with:
fetch-depth: ${{ github.event_name == 'pull_request' && 2 || 0 }}
- name: Get changed files
id: changed-files
run: |
if ${{ github.event_name == 'pull_request' }}; then
echo "changed_files=$(git diff --name-only --diff-filter=ACM -r HEAD^1 HEAD | xargs)" >> $GITHUB_OUTPUT
else
echo "changed_files=$(git diff --name-only --diff-filter=ACM ${{ github.event.before }} ${{ github.event.after }} | xargs)" >> $GITHUB_OUTPUT
fi
- name: Enable corepack to fix https://github.com/actions/setup-node/pull/901
run: corepack enable pnpm
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install project dependencies
run: corepack pnpm install --frozen-lockfile
- name: Run exercism/javascript ci (runs tests) for changed/added exercises
run: corepack pnpm node scripts/pr.mjs ${{ steps.changed-files.outputs.changed_files }}