Skip to content

Database fixed todos #67

Database fixed todos

Database fixed todos #67

Workflow file for this run

name: build_test
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build_test:
timeout-minutes: 30
strategy:
matrix:
os: [ubuntu-latest]
kind: [debug, release]
runs-on: ${{ matrix.os }}
services:
postgres:
image: postgres:15-alpine
env:
POSTGRES_DB: fuzzilli
POSTGRES_USER: fuzzilli
POSTGRES_PASSWORD: fuzzilli123
POSTGRES_INITDB_ARGS: "--encoding=UTF-8 --lc-collate=C --lc-ctype=C"
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U fuzzilli -d fuzzilli"
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
SWIFT_VERSION: 6.1
DATABASE_URL: postgresql://fuzzilli:fuzzilli123@localhost:5432/fuzzilli
steps:
- uses: actions/setup-node@v4
with:
node-version: 25-nightly
# Is it failing to run tests b/c we're overriding
# what swift binary to use?
- name: Setup Swift
run: |
wget -q https://download.swift.org/swift-${SWIFT_VERSION}-release/ubuntu2204/swift-${SWIFT_VERSION}-RELEASE/swift-${SWIFT_VERSION}-RELEASE-ubuntu22.04.tar.gz
tar xzf swift-${SWIFT_VERSION}-RELEASE-ubuntu22.04.tar.gz
mv swift-${SWIFT_VERSION}-RELEASE-ubuntu22.04 /opt/swift
rm swift-${SWIFT_VERSION}-RELEASE-ubuntu22.04.tar.gz
export PATH="/opt/swift/usr/bin:${PATH}"
- uses: actions/checkout@v2
- name: Install PostgreSQL Client Tools
run: |
sudo apt-get update
sudo apt-get install -y postgresql-client
- name: Setup PostgreSQL Database Schema
run: |
# Wait for PostgreSQL service to be ready
until pg_isready -h localhost -p 5432 -U fuzzilli; do
echo "Waiting for PostgreSQL service to be ready..."
sleep 2
done
# Initialize the database schema
PGPASSWORD=fuzzilli123 psql -h localhost -p 5432 -U fuzzilli -d fuzzilli -f postgres-init.sql
# Verify the schema was created
PGPASSWORD=fuzzilli123 psql -h localhost -p 5432 -U fuzzilli -d fuzzilli -c "
SELECT table_name
FROM information_schema.tables
WHERE table_schema = 'public'
ORDER BY table_name;
"
- name: Build
run: swift build -c ${{ matrix.kind }} -v
- name: Run tests with Node.js
run: swift test -c ${{ matrix.kind }} -v
- name: Install jsvu
run: npm install jsvu -g
- name: Install d8
run: jsvu --os=default --engines=v8
- name: Run tests with d8
run: FUZZILLI_TEST_SHELL=~/.jsvu/engines/v8/v8 swift test -c ${{ matrix.kind }} -v