Run playwright tests on pull request as well

This commit is contained in:
thiloho
2024-09-13 18:45:23 +02:00
parent 08aca588d0
commit db8b284d6f
6 changed files with 14 additions and 8 deletions

View File

@@ -2,8 +2,8 @@ name: Deploy app to demo server (demo.archtika.com)
on: on:
workflow_run: workflow_run:
workflows: ['Playwright tests'] workflows: [ 'Playwright tests' ]
types: [completed] types: [ completed ]
env: env:
SERVER_USER: root SERVER_USER: root
SERVER_IP: 128.140.75.240 SERVER_IP: 128.140.75.240

View File

@@ -2,8 +2,9 @@ name: Playwright tests
on: on:
push: push:
branches: branches: [ main ]
- main pull_request:
branches: [ main ]
jobs: jobs:
test: test:

View File

@@ -18,7 +18,7 @@ CREATE FUNCTION internal.track_changes ()
DECLARE DECLARE
_website_id UUID; _website_id UUID;
BEGIN BEGIN
IF (to_jsonb (OLD.*) - 'last_modified_at') = (to_jsonb (NEW.*) - 'last_modified_at') OR (to_jsonb (OLD.*) - 'last_modified_by') = (to_jsonb (NEW.*) - 'last_modified_by') THEN IF (to_jsonb (OLD.*) - 'last_modified_at') = (to_jsonb (NEW.*) - 'last_modified_at') THEN
RETURN NEW; RETURN NEW;
END IF; END IF;
IF TG_TABLE_NAME = 'website' THEN IF TG_TABLE_NAME = 'website' THEN

View File

@@ -1,5 +1,6 @@
import { redirect } from "@sveltejs/kit"; import { redirect } from "@sveltejs/kit";
import { API_BASE_PREFIX } from "$lib/server/utils"; import { API_BASE_PREFIX } from "$lib/server/utils";
import type { User } from "$lib/db-schema";
export const handle = async ({ event, resolve }) => { export const handle = async ({ event, resolve }) => {
if (!event.url.pathname.startsWith("/api/")) { if (!event.url.pathname.startsWith("/api/")) {
@@ -21,7 +22,7 @@ export const handle = async ({ event, resolve }) => {
throw redirect(303, "/"); throw redirect(303, "/");
} }
const user = await userData.json(); const user: User = await userData.json();
event.locals.user = user; event.locals.user = user;
} }

View File

@@ -25,7 +25,9 @@
<header> <header>
<div class="container"> <div class="container">
<hgroup> <hgroup>
{#if article.publication_date}
<p>{article.publication_date}</p> <p>{article.publication_date}</p>
{/if}
<h1>{article.title}</h1> <h1>{article.title}</h1>
</hgroup> </hgroup>
{#if article.cover_image} {#if article.cover_image}

View File

@@ -44,7 +44,9 @@
{#each websiteOverview.article as article} {#each websiteOverview.article as article}
{@const articleFileName = article.title.toLowerCase().split(" ").join("-")} {@const articleFileName = article.title.toLowerCase().split(" ").join("-")}
<li> <li>
{#if article.publication_date}
<p>{article.publication_date}</p> <p>{article.publication_date}</p>
{/if}
<p> <p>
<strong> <strong>
<a href="./articles/{articleFileName}">{article.title}</a> <a href="./articles/{articleFileName}">{article.title}</a>