Dev → Main #59
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: Pull Request | |
on: | |
pull_request: | |
jobs: | |
setup: | |
name: Setup | |
runs-on: ubuntu-latest | |
steps: | |
- name: Cancel previous | |
uses: styfle/cancel-workflow-action@0.11.0 | |
with: | |
access_token: ${{ secrets.GITHUB_TOKEN }} | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "20.x" | |
cache: "npm" | |
cache-dependency-path: "package-lock.json" | |
- name: Install deps | |
run: npm ci | |
- name: Cache node_modules | |
uses: actions/cache/save@v3 | |
with: | |
path: node_modules | |
key: node-modules-${{ hashFiles('package-lock.json') }} | |
lint: | |
name: Lint | |
needs: setup | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "20.x" | |
- name: Restore node_modules | |
uses: actions/cache/restore@v3 | |
with: | |
path: node_modules | |
key: node-modules-${{ hashFiles('package-lock.json') }} | |
fail-on-cache-miss: true | |
- name: Lint JS and Vue | |
run: npm run lint | |
test: | |
name: Test | |
needs: setup | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "20.x" | |
- name: Restore node_modules | |
uses: actions/cache/restore@v3 | |
with: | |
path: node_modules | |
key: node-modules-${{ hashFiles('package-lock.json') }} | |
fail-on-cache-miss: true | |
- uses: szenius/set-timezone@v1.2 | |
with: | |
timezoneLinux: "America/New_York" | |
- name: Run tests | |
run: npm run test:ci | |
build: | |
name: Build | |
needs: setup | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "20.x" | |
- name: Restore node_modules | |
uses: actions/cache/restore@v3 | |
with: | |
path: node_modules | |
key: node-modules-${{ hashFiles('package-lock.json') }} | |
fail-on-cache-miss: true | |
- name: Build app | |
run: npm run build |