Merge pull request #4 from toggle-corp/feature/graphql-apollo #7
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: Lint, Build and Test | |
on: | |
pull_request: | |
push: | |
branches: | |
- 'develop' | |
env: | |
APP_TITLE: ${{ vars.APP_TITLE }} | |
GITHUB_WORKFLOW: true | |
jobs: | |
test: | |
name: Run tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4 | |
name: Install pnpm | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install | |
- name: Run test | |
run: pnpm test | |
unused: | |
name: Find unused things | |
environment: 'test' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4 | |
name: Install pnpm | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install | |
- name: Run knip | |
run: pnpm lint:unused | |
lint-js: | |
name: Lint JS | |
environment: 'test' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4 | |
name: Install pnpm | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install | |
- name: Lint Javascript | |
run: pnpm lint:js | |
css-lint: | |
name: Lint CSS | |
environment: 'test' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4 | |
name: Install pnpm | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install | |
- name: Css Lint | |
run: pnpm lint:css | |
typecheck: | |
name: Typecheck | |
environment: 'test' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4 | |
name: Install pnpm | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install | |
- name: Lint Javascript | |
run: pnpm typecheck | |
build: | |
name: Build | |
environment: 'test' | |
needs: [lint-js, css-lint, typecheck] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4 | |
name: Install pnpm | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install | |
- name: Build | |
run: pnpm build |