root-add-lintrc #17
Workflow file for this run
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"] | |
pull_request: | |
types: [opened, synchronize] | |
jobs: | |
test-build: | |
name: Test and building | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repo | |
uses: actions/checkout@v3 | |
- name: Set up Node.js 20 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
- name: Setup pnpm | |
uses: pnpm/[email protected] | |
with: | |
version: 8.6.6 | |
- name: Get pnpm store directory | |
id: pnpm-cache | |
run: | | |
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT | |
- name: Setup pnpm cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- name: Install dependencies | |
run: pnpm install | |
- name: Build cache | |
uses: actions/cache@v3 | |
with: | |
# See here for caching with `yarn` https://github.com/actions/cache/blob/main/examples.md#node---yarn or you can leverage caching with actions/setup-node https://github.com/actions/setup-node | |
path: | | |
~/.npm | |
${{ github.workspace }}/.next/cache | |
# Generate a new cache whenever packages or source files change. | |
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.[jt]s', '**/*.[jt]sx') }} | |
# If source files changed but packages didn't, rebuild from a prior cache. | |
restore-keys: | | |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}- | |
- name: Building | |
run: pnpm build | |
env: | |
DATABASE_URL: "http://localhost:3000" | |
NEXTAUTH_SECRET: "random" | |
NEXTAUTH_URL: "http://localhost:3000" | |
GITHUB_CLIENT_ID: "123" | |
GITHUB_CLIENT_SECRET: "1234" | |
GOOGLE_CLIENT_ID: "12345" | |
GOOGLE_CLIENT_SECRET: "123456" | |
FACEBOOK_CLIENT_ID: "1234567" | |
FACEBOOK_CLIENT_SECRET: "12345678" | |
- name: lintrc | |
run: pnpm lint | |
env: | |
DATABASE_URL: "http://localhost:3000" | |
NEXTAUTH_SECRET: "random" | |
NEXTAUTH_URL: "http://localhost:3000" | |
GITHUB_CLIENT_ID: "123" | |
GITHUB_CLIENT_SECRET: "1234" | |
GOOGLE_CLIENT_ID: "12345" | |
GOOGLE_CLIENT_SECRET: "123456" | |
FACEBOOK_CLIENT_ID: "1234567" | |
FACEBOOK_CLIENT_SECRET: "12345678" | |
- name: Type-checking | |
run: pnpm type-check | |