This commit introduces the `force-ipv4` GitHub action to address connectivity issues caused by the lack of IPv6 support in GitHub runners. Details: - actions/runner#3138 - actions/runner-images#668 This change solves connection problems when Node's `fetch` API fails due to `UND_ERR_CONNECT_TIMEOUT` errors. Details: - actions/runner-images#9540 - actions/runner#3213 This action disables IPv6 at the system level, ensuring all outging requests use IPv4. Resolving connectivity issues when running external URL checks and Docker build checks. This solution is a temporary workaround until GitHub runners support IPv6 or Node `fetch` API has a working solution such as Happy Eyeball. Detais: - nodejs/node#41625 - nodejs/undici#1531
107 lines
3.4 KiB
YAML
107 lines
3.4 KiB
YAML
name: checks.build
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
|
|
jobs:
|
|
build-web:
|
|
strategy:
|
|
matrix:
|
|
os: [ macos, ubuntu, windows ]
|
|
mode: [
|
|
# Vite mode: https://vitejs.dev/guide/env-and-mode.html
|
|
development, # Used by `dev` command
|
|
production, # Used by `build` command
|
|
# Vitest mode: https://vitest.dev/guide/cli.html
|
|
test, # Used by Vitest
|
|
]
|
|
fail-fast: false # Allows to see results from other combinations
|
|
runs-on: ${{ matrix.os }}-latest
|
|
steps:
|
|
-
|
|
name: Checkout
|
|
uses: actions/checkout@v4
|
|
-
|
|
name: Setup node
|
|
uses: ./.github/actions/setup-node
|
|
-
|
|
name: Install dependencies
|
|
uses: ./.github/actions/npm-install-dependencies
|
|
-
|
|
name: Build web
|
|
run: npm run build -- --mode ${{ matrix.mode }}
|
|
-
|
|
name: Verify web build artifacts
|
|
run: npm run check:verify-build-artifacts -- --web
|
|
|
|
build-desktop:
|
|
strategy:
|
|
matrix:
|
|
os: [ macos, ubuntu, windows ]
|
|
mode: [
|
|
# electron-vite modes: https://electron-vite.org/guide/env-and-mode.html#global-env-variables
|
|
development, # Used by `dev` command
|
|
production, # Used by `build` and `preview` commands
|
|
]
|
|
fail-fast: false # Allows to see results from other combinations
|
|
runs-on: ${{ matrix.os }}-latest
|
|
steps:
|
|
-
|
|
name: Checkout
|
|
uses: actions/checkout@v4
|
|
-
|
|
name: Setup node
|
|
uses: ./.github/actions/setup-node
|
|
-
|
|
name: Install dependencies
|
|
uses: ./.github/actions/npm-install-dependencies
|
|
-
|
|
name: Prebuild desktop
|
|
run: npm run electron:prebuild -- --mode ${{ matrix.mode }}
|
|
-
|
|
name: Verify unbundled desktop build artifacts
|
|
run: npm run check:verify-build-artifacts -- --electron-unbundled
|
|
-
|
|
name: Build (bundle and package) desktop application
|
|
run: npm run electron:build -- --publish never
|
|
-
|
|
name: Verify bundled desktop build artifacts
|
|
run: npm run check:verify-build-artifacts -- --electron-bundled
|
|
|
|
build-docker:
|
|
strategy:
|
|
matrix:
|
|
os: [ macos, ubuntu ] # Windows runners do not support Linux containers
|
|
fail-fast: false # Allows to see results from other combinations
|
|
runs-on: ${{ matrix.os }}-latest
|
|
steps:
|
|
-
|
|
name: Checkout
|
|
uses: actions/checkout@v4
|
|
-
|
|
name: Install Docker on macOS
|
|
if: matrix.os == 'macos' # macOS runner is missing Docker
|
|
run: |-
|
|
# Install Docker
|
|
brew install docker
|
|
# Docker on macOS misses daemon due to licensing, so install colima as runtime
|
|
brew install colima
|
|
# Start the daemon
|
|
colima start
|
|
-
|
|
name: Build Docker image
|
|
run: docker build -t undergroundwires/privacy.sexy:latest .
|
|
-
|
|
name: Run Docker image on port 8080
|
|
run: docker run -d -p 8080:80 --rm --name privacy.sexy undergroundwires/privacy.sexy:latest
|
|
-
|
|
name: Enforce IPv4 Connectivity # Used due to GitHub runners' lack of IPv6 support, preventing request timeouts.
|
|
uses: ./.github/actions/force-ipv4
|
|
-
|
|
name: Check server is up and returns HTTP 200
|
|
run: >-
|
|
node ./scripts/verify-web-server-status.js \
|
|
--url http://localhost:8080 \
|
|
--max-retries ${{ matrix.os == 'macos' && '90' || '30' }}
|