Merge Upstream #74
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: build_test | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| build_test: | |
| timeout-minutes: 30 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [macos-latest, ubuntu-latest] | |
| kind: [debug] | |
| include: | |
| - os: ubuntu-latest | |
| kind: release | |
| runs-on: ${{ matrix.os }} | |
| env: | |
| SWIFT_VERSION: 6.1 | |
| DATABASE_URL: postgresql://postgres:postgres@localhost:5432/fuzzilli | |
| services: | |
| postgres: | |
| image: postgres:16 | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: fuzzilli | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd="pg_isready -U postgres" | |
| --health-interval=5s | |
| --health-timeout=5s | |
| --health-retries=10 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Setup Swift (Linux only) | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update -q | |
| sudo apt-get install -y libicu-dev libxml2 libsqlite3-dev libblocksruntime-dev tzdata | |
| 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 | |
| sudo mv swift-${SWIFT_VERSION}-RELEASE-ubuntu22.04 /opt/swift | |
| echo "/opt/swift/usr/bin" | sudo tee -a /etc/environment | |
| echo "/opt/swift/usr/bin" >> $GITHUB_PATH | |
| - name: Wait for PostgreSQL | |
| run: | | |
| echo "Waiting for PostgreSQL to become ready..." | |
| for i in {1..20}; do | |
| pg_isready -h localhost -p 5432 -U postgres && break | |
| sleep 2 | |
| done | |
| psql $DATABASE_URL -c 'SELECT version();' | |
| - name: Build | |
| run: swift build -c ${{ matrix.kind }} -v | |
| - name: Run tests | |
| env: | |
| DATABASE_URL: ${{ env.DATABASE_URL }} | |
| 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 | |
| env: | |
| FUZZILLI_TEST_SHELL: ~/.jsvu/engines/v8/v8 | |
| DATABASE_URL: ${{ env.DATABASE_URL }} | |
| run: swift test -c ${{ matrix.kind }} -v |