Skip to content

Commit 3aac185

Browse files
committed
Test
1 parent 4bc33c6 commit 3aac185

1 file changed

Lines changed: 42 additions & 22 deletions

File tree

.github/workflows/swift.yml

Lines changed: 42 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,18 @@
1-
21
jobs:
3-
build_test:
2+
build_test_linux:
43
timeout-minutes: 30
54
strategy:
6-
# If macos-latest fails, we still don't want to cancel ubuntu-latest or the other way around.
75
fail-fast: false
86
matrix:
9-
os: [macos-latest, ubuntu-latest]
10-
kind: [debug]
11-
include:
12-
# On linux also build and test release.
13-
- os: ubuntu-latest
14-
kind: release
7+
# Linux runs both debug and release
8+
kind: [debug, release]
159

16-
runs-on: ${{ matrix.os }}
10+
runs-on: ubuntu-latest
1711

18-
# --- NEW SERVICE CONTAINER BLOCK ---
1912
# Service containers are only supported on Linux
2013
services:
2114
# Label used to access the service container
2215
postgres:
23-
if: matrix.os == 'ubuntu-latest'
2416
# Docker Hub image
2517
image: postgres
2618
# Use 'trust' auth to allow password-less connections,
@@ -45,10 +37,7 @@ jobs:
4537
with:
4638
node-version: 25-nightly
4739

48-
# Is it failing to run tests b/c we're overriding
49-
# what swift binary to use?
5040
- name: Setup Swift for Ubuntu
51-
if: runner.os == 'Linux'
5241
run: |
5342
wget -q https://download.swift.org/swift-${SWIFT_VERSION}-release/ubuntu2204/swift-${SWIFT_VERSION}-RELEASE/swift-${SWIFT_VERSION}-RELEASE-ubuntu22.04.tar.gz
5443
tar xzf swift-${SWIFT_VERSION}-RELEASE-ubuntu22.04.tar.gz
@@ -57,18 +46,50 @@ jobs:
5746
export PATH="/opt/swift/usr/bin:${PATH}"
5847
- uses: actions/checkout@v2
5948

60-
# --- MODIFIED STEP FOR LINUX ---
61-
# This step just creates the DB in the service container.
6249
- name: Create PostgreSQL database (Linux)
63-
if: runner.os == 'Linux'
6450
run: |
6551
# The service container is running on localhost:5432
6652
# We just need to create the database. Auth is 'trust'.
53+
# Wait a few seconds for the service to be fully ready after health check
54+
sleep 5
6755
createdb -h localhost -p 5432 fuzzilli
6856
69-
# --- UNCHANGED STEP FOR MACOS ---
57+
- name: Build
58+
run: swift build -c ${{ matrix.kind }} -v
59+
- name: Run tests with Node.js
60+
run: swift test -c ${{ matrix.kind }} -v
61+
- name: Install jsvu
62+
run: npm install jsvu -g
63+
- name: Install d8
64+
run: jsvu --os=default --engines=v8
65+
- name: Run tests with d8
66+
run: FUZZILLI_TEST_SHELL=~/.jsvu/engines/v8/v8 swift test -c ${{ matrix.kind }} -v
67+
68+
build_test_macos:
69+
timeout-minutes: 30
70+
strategy:
71+
fail-fast: false
72+
matrix:
73+
# macOS only runs debug
74+
kind: [debug]
75+
76+
runs-on: macos-latest
77+
78+
# No 'services' block here, as it's not supported on macOS
79+
80+
env:
81+
SWIFT_VERSION: 6.1
82+
83+
steps:
84+
- uses: actions/setup-node@v4
85+
with:
86+
node-version: 25-nightly
87+
88+
# No Swift setup needed for macOS, it uses the pre-installed one
89+
90+
- uses: actions/checkout@v2
91+
7092
- name: Start PostgreSQL and create database (macOS)
71-
if: runner.os == 'macOS'
7293
run: |
7394
# Start the pre-installed postgresql service
7495
brew services start postgresql
@@ -78,8 +99,6 @@ jobs:
7899
# On macOS/brew, this usually works without password auth by default for the current user.
79100
createdb fuzzilli
80101
81-
# --- END OF NEW STEPS ---
82-
83102
- name: Build
84103
run: swift build -c ${{ matrix.kind }} -v
85104
- name: Run tests with Node.js
@@ -90,3 +109,4 @@ jobs:
90109
run: jsvu --os=default --engines=v8
91110
- name: Run tests with d8
92111
run: FUZZILLI_TEST_SHELL=~/.jsvu/engines/v8/v8 swift test -c ${{ matrix.kind }} -v
112+

0 commit comments

Comments
 (0)