Skip to content

fix: vars in github action (#912) #16

fix: vars in github action (#912)

fix: vars in github action (#912) #16

Workflow file for this run

name: Node.js CI
permissions:
contents: write
packages: write
on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: "Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)"
required: false
default: false
jobs:
test:
if: github.actor != 'renovate[bot]'
timeout-minutes: 60
env:
CI: true
ESLINT_USE_FLAT_CONFIG: true
SUPABASE_URL: http://localhost:54321
VITE_BASE_URL: http://localhost:5173
VITE_RECOVERY_AUTH_REDIRECT_URL: http://localhost:5173/profile/reset-password
VITE_SUPABASE_URL: http://localhost:54321
TEST_SUPABASE_INBUCKET_URL: http://localhost:54324
# The values below are taken from the command `supabase start`
# WARNING: Don't use production URLs or tokens here
SUPABASE_ANON_KEY: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0
VITE_SUPABASE_ANON_KEY: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0
SUPABASE_SERVICE_ROLE_KEY: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImV4cCI6MTk4MzgxMjk5Nn0.EGIM96RAZx35lJzdJsyH-qQwv8Hdp7fsn3W0YpN81IU
VITE_MATOMO_SITE_ID: ""
VITE_MATOMO_URL: ""
VITE_MAP_BOUNDING_BOX: "13.0824446341071,52.3281202651866,13.7682544186827,52.681600197973"
VITE_MAP_CENTER_LNG: "13.388836926491992"
VITE_MAP_CENTER_LAT: "52.494590307846366"
VITE_MAPBOX_API_ENDPOINT: "https://api.mapbox.com"
VITE_MAP_PITCH_DEGREES: "45"
VITE_MAP_MAX_ZOOM_LEVEL: "20"
VITE_MAP_MIN_ZOOM_LEVEL: "10"
VITE_MAP_INITIAL_ZOOM_LEVEL: "11"
VITE_MAP_LOCATION_ZOOM_LEVEL: "17"
VITE_API_ENDPOINT: "http://localhost:8080"
VITE_MAPBOX_API_KEY: ${{ secrets.VITE_MAPBOX_API_KEY }}
VITE_MAPBOX_STYLE_URL: ${{ secrets.VITE_MAPBOX_STYLE_URL }}
VITE_MAPBOX_TREES_TILESET_URL: ${{ secrets.VITE_MAPBOX_TREES_TILESET_URL }}
VITE_MAPBOX_TREES_TILESET_LAYER: ${{ secrets.VITE_MAPBOX_TREES_TILESET_LAYER }}
VITE_MAP_PUMPS_SOURCE_URL: ${{ secrets.VITE_MAP_PUMPS_SOURCE_URL }}
SUPABASE_MAX_ROWS: 10000
# Set to scheme, domain and possibly port (if something else than port 80) of the origin you are expecting
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin
ACCESS_CONTROL_ALLOW_ORIGIN: "*"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js from .nvmrc
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
# This is in preparation for release:
# we clone the staging and master branches of the api
# and install the supabase CLI
#
# - name: Get the source for the api staging
# id: checkout-api-staging
# uses: actions/checkout@v4
# if: github.event.pull_request.base.ref == 'staging' || github.ref == 'refs/heads/staging'
# with:
# repository: technologiestiftung/giessdenkiez-de-postgres-api
# path: api
# ref: staging
# - name: Get the source for the api master
# id: checkout-api-master
# uses: actions/checkout@v4
# if: github.event.pull_request.base.ref == 'master' || github.ref == 'refs/heads/master'
# with:
# repository: technologiestiftung/giessdenkiez-de-postgres-api
# path: api
# - uses: supabase/setup-cli@v1
# with:
# version: 1.142.2
- name: Setup tmate session for dispatch
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
with:
limit-access-to-actor: true
# please see https://github.com/mxschmitt/action-tmate
- run: npm ci
- name: Get the source for the api
id: checkout-api
uses: actions/checkout@v4
with:
repository: technologiestiftung/giessdenkiez-de-postgres-api
ref: "staging"
path: api
- uses: supabase/setup-cli@v1
with:
version: 1.142.2
# Start the supabase & API
- name: Start supabase
run: |
cd api
npm ci
supabase start
npm run vercel:dev &
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: npm run test --if-present
- name: Tmate session
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
timeout-minutes: 15
with:
limit-access-to-actor: true
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: test-results/
retention-days: 30