mirror of
https://github.com/actions/deploy-pages.git
synced 2025-12-08 08:06:15 +00:00
37 lines
709 B
YAML
37 lines
709 B
YAML
name: Run Tests
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: checkout
|
|
uses: actions/checkout@v3
|
|
|
|
# check the node version from the .node-version file
|
|
- name: fetch node version
|
|
id: node-version
|
|
run: |
|
|
version=$(cat .node-version)
|
|
echo "version=${version}" >> $GITHUB_OUTPUT
|
|
|
|
- name: setup node
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: ${{ steps.node-version.outputs.version }}
|
|
cache: npm
|
|
|
|
- name: install dependencies
|
|
run: npm ci
|
|
|
|
- name: run tests
|
|
run: npm run test
|