Skip to content

Merge pull request #8 from nitic-pbl-p8/7/add-header-for-auth-guarded… #95

Merge pull request #8 from nitic-pbl-p8/7/add-header-for-auth-guarded…

Merge pull request #8 from nitic-pbl-p8/7/add-header-for-auth-guarded… #95

Workflow file for this run

name: app test
on: push
env:
DATABASE_URL: postgresql://postgres:postgres@localhost:54322/postgres
NEXT_PUBLIC_GRAPHQL_ENDPOINT: ${{ secrets.NEXT_PUBLIC_GRAPHQL_ENDPOINT }}
NEXT_PUBLIC_WS_ENDPOINT: ${{ secrets.NEXT_PUBLIC_WS_ENDPOINT }}
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
jobs:
filter:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
outputs:
app: ${{ steps.changes.outputs.app }}
steps:
- name: checkout
uses: actions/checkout@v4
- name: check for file changes
uses: dorny/paths-filter@v2
id: changes
with:
token: ${{ github.token }}
filters: .github/filter.yaml
test:
runs-on: ubuntu-latest
env:
SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }}
SUPABASE_AUTH_EXTERNAL_GOOGLE_CLIENT_ID: ${{ secrets.SUPABASE_AUTH_EXTERNAL_GOOGLE_CLIENT_ID }}
SUPABASE_AUTH_EXTERNAL_GOOGLE_SECRET: ${{ secrets.SUPABASE_AUTH_EXTERNAL_GOOGLE_SECRET }}
SUPABASE_AUTH_EXTERNAL_GOOGLE_URL: ${{ secrets.SUPABASE_AUTH_EXTERNAL_GOOGLE_URL }}
SUPABASE_DB_PASSWORD: ${{ secrets.SUPABASE_DB_PASSWORD }}
needs: filter
steps:
- name: checkout
uses: actions/checkout@v4
- name: setup supabase cli
uses: supabase/setup-cli@v1
with:
version: latest
- name: setup node
uses: actions/setup-node@v3
with:
node-version-file: "package.json"
- name: setup pnpm
uses: pnpm/action-setup@v2
id: pnpm-install
with:
run_install: false
- name: setup pnpm environment variable
id: pnpm-env
run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: cache pnpm dependencies
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-env.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-dependencies-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: ${{ runner.os }}-pnpm-dependencies-
- name: install dependencies
run: pnpm install --frozen-lockfile
- name: authenticate to supabase
run: pnpm supabase link --project-ref ${{ secrets.SUPABASE_REFERENCE_ID }}
- name: test
run: pnpm turbo run test
app-test-check:
runs-on: ubuntu-latest
needs: test
if: ${{ ! failure() }}
steps:
- name: check
run: echo "test is successfully executed."