76 lines
2.3 KiB
YAML
76 lines
2.3 KiB
YAML
name: ci
|
|
|
|
on:
|
|
push:
|
|
branches: [master]
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
frontend:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '24'
|
|
cache: npm
|
|
cache-dependency-path: frontend/package-lock.json
|
|
- run: npm ci
|
|
working-directory: frontend
|
|
- run: npm run build
|
|
working-directory: frontend
|
|
|
|
backend:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
MODULUS_DIRECT: '1'
|
|
CONAN_HOME: build/build_common/conan_cache
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Install build dependencies
|
|
run: |
|
|
apt-get update
|
|
apt-get install -y --no-install-recommends \
|
|
build-essential ca-certificates cmake g++-12 gcc-12 \
|
|
git ninja-build pkg-config python3 python3-venv
|
|
python3 -m venv build/build_common/ci_python
|
|
build/build_common/ci_python/bin/python -m pip install conan==2.26.2
|
|
echo "$PWD/build/build_common/ci_python/bin" >> "$GITHUB_PATH"
|
|
- name: Restore Conan cache
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: build/build_common/conan_cache
|
|
key: product_fpol_conan_${{ runner.os }}_${{ hashFiles('conanfile.py', 'modulus.json') }}
|
|
restore-keys: product_fpol_conan_${{ runner.os }}_
|
|
- name: Configure
|
|
run: python3 modulus.py configure --all --update
|
|
- name: Check formatting
|
|
run: |
|
|
python3 -m pip install -r build/build_tools/docker/format_requirements.txt
|
|
python3 modulus.py format --check
|
|
- name: Build
|
|
run: python3 modulus.py build --all
|
|
- name: Test
|
|
run: python3 modulus.py test --all
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '24'
|
|
- name: Build frontend for browser checks
|
|
run: |
|
|
npm --prefix frontend ci
|
|
npm --prefix frontend run build
|
|
- uses: browser-actions/setup-chrome@v2
|
|
id: chrome
|
|
with:
|
|
chrome-version: stable
|
|
install-dependencies: true
|
|
no-sudo: true
|
|
- name: Browser smoke with real C++ server
|
|
env:
|
|
FPOL_CHROMIUM: ${{ steps.chrome.outputs.chrome-path }}
|
|
run: node tests/browser.mjs build/build_x86_debug/fpol_server
|