GitHub warned on every run that checkout@v4, setup-node@v4 and pnpm/action-setup@v4 target the deprecated Node 20. checkout v7 and action-setup v6 run on node24; setup-node is dropped because the check job already runs in node:24. Task: M6-T8
41 lines
1.4 KiB
YAML
41 lines
1.4 KiB
YAML
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
# Runs on GitHub Actions and Gitea/Forgejo Actions (both read .github/workflows).
|
|
name: ci
|
|
on:
|
|
push:
|
|
pull_request:
|
|
|
|
jobs:
|
|
check:
|
|
runs-on: ubuntu-latest
|
|
# Run in a container so the service is reachable by its name ("postgres") on every runner:
|
|
# GitHub's hosted runners only give services a DNS name inside container jobs.
|
|
container: node:24
|
|
services:
|
|
postgres:
|
|
image: postgres:18-alpine
|
|
env:
|
|
POSTGRES_USER: selfphoneng
|
|
POSTGRES_PASSWORD: ci
|
|
POSTGRES_DB: selfphoneng
|
|
options: >-
|
|
--health-cmd "pg_isready -U selfphoneng" --health-interval 5s --health-retries 20
|
|
env:
|
|
TEST_DATABASE_URL: postgres://selfphoneng:ci@postgres:5432/selfphoneng
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- uses: pnpm/action-setup@v6 # version comes from package.json "packageManager"
|
|
# Sound and greeting tests convert real audio (skipped without ffmpeg).
|
|
- run: apt-get update -qq && apt-get install -y -qq --no-install-recommends ffmpeg
|
|
- run: pnpm install --frozen-lockfile
|
|
- run: pnpm lint
|
|
- run: pnpm typecheck
|
|
- run: pnpm test
|
|
|
|
images:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- run: docker build -f apps/api/Dockerfile -t selfphoneng-api:ci .
|
|
- run: docker build -t selfphoneng-asterisk:ci asterisk
|