fix: mount /apps and docker socket in PR workflow build-and-deploy-ci job (#41)
Build CI Images / build-ci-base (push) Successful in 1m53s
Release / release (push) Failing after 12m42s

Reviewed-on: #41
Co-authored-by: David Gwilliam <dhgwilliam@gmail.com>
Co-committed-by: David Gwilliam <dhgwilliam@gmail.com>
This commit was merged in pull request #41.
This commit is contained in:
2026-05-20 19:51:35 +00:00
committed by david
parent 861e14503b
commit e455d5dba5
41 changed files with 11130 additions and 533 deletions
+43 -25
View File
@@ -127,7 +127,7 @@ Given('I am logged in as a tournament admin', async function () {
// Wait for any redirect away from register page
await world.page.waitForURL((url) => !url.toString().includes('/auth/register'), { timeout: 15000 });
await world.page.waitForLoadState('networkidle');
await world.page.waitForLoadState('domcontentloaded');
await world.page.waitForTimeout(1000);
const currentUrl = world.page.url();
@@ -166,7 +166,7 @@ Given('I am logged in as a tournament admin', async function () {
// Navigate to trigger a fresh role fetch
await world.page.goto(`${world.baseURL}/rankings`);
await world.page.waitForLoadState('networkidle');
await world.page.waitForLoadState('domcontentloaded');
await world.page.waitForTimeout(500);
} else {
console.log(`🌍 WARNING: User not found in DB by email. Trying to find latest user...`);
@@ -235,7 +235,7 @@ Given('I am logged in as a site admin', async function () {
// Navigate to home page to trigger Navigation re-mount with new role
await world.page.goto(`${world.baseURL}/`);
await world.page.waitForLoadState('networkidle');
await world.page.waitForLoadState('domcontentloaded');
await world.page.waitForTimeout(1000);
}
}
@@ -245,35 +245,53 @@ Given('I am logged in as a site admin', async function () {
/**
* Precondition: I am logged in as a club admin
* Uses a pre-existing admin user from the database
* Creates a new user via UI and assigns club_admin role via Prisma
*/
Given('I am logged in as a club admin', async function () {
console.log('🌍 Logging in as existing club admin...');
console.log('🌍 Creating and logging in as a club admin...');
// Use the admin user created by seed.js
const adminEmail = 'david@dhg.lol';
const adminPassword = 'adminadmin';
const credentials = generateTestCredentials();
world.user = credentials;
world.user = {
email: adminEmail,
password: adminPassword,
name: 'David Admin',
};
await world.page.goto(`${world.baseURL}/auth/login`);
await world.page.goto(`${world.baseURL}/auth/register`);
await world.page.waitForLoadState('domcontentloaded');
await world.page.fill('input[name="email"]', adminEmail);
await world.page.fill('input[name="password"]', adminPassword);
await world.page.click('button[type="submit"]');
await world.page.fill('input[name="name"]', credentials.name);
await world.page.fill('input[name="email"]', credentials.email);
await world.page.fill('input[name="password"]', credentials.password);
// Wait for redirect after login
try {
await world.page.waitForURL((url) => !url.toString().includes('/auth/login'), { timeout: 10000 });
console.log(`🌍 Club admin logged in: ${adminEmail}`);
} catch (e) {
console.log('🌍 Login redirect timed out, current URL:', world.page.url());
await world.page.click('button[type="submit"]');
await world.page.waitForURL(/\/players\/\d+\/profile/, { timeout: 15000 });
const currentUrl = world.page.url();
const match = currentUrl.match(/\/players\/(\d+)\/profile/);
if (match) {
const playerId = match[1];
world.playerId = playerId;
const prisma = await world.getPrisma();
const player = await prisma.player.findUnique({
where: { id: parseInt(playerId) },
include: { user: true }
});
if (player && player.user) {
const userId = player.user.id;
(world.user as any).id = userId;
await prisma.user.update({
where: { id: userId },
data: { role: 'club_admin' }
});
console.log(`🌍 Assigned club_admin role to user: ${userId}`);
await world.page.goto(`${world.baseURL}/`);
await world.page.waitForLoadState('domcontentloaded');
await world.page.waitForTimeout(1000);
}
}
console.log(`🌍 Club admin created: ${credentials.email}`);
});
/**
@@ -566,7 +584,7 @@ When('I go to the tournament schedule page', async function () {
const tournamentId = world.tournament?.id || 1;
const url = `${world.baseURL}/admin/tournaments/${tournamentId}/schedule?t=${Date.now()}`;
await world.page.goto(url);
await world.page.waitForLoadState('networkidle');
await world.page.waitForLoadState('domcontentloaded');
// Wait for ScheduleDisplay client component to hydrate
await world.page.waitForTimeout(2000);
});