Skip to content

Add --strict convention checker for dual-mode composability #163

Add --strict convention checker for dual-mode composability

Add --strict convention checker for dual-mode composability #163

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
format-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check formatting
run: make format-check
build-linux:
needs: format-check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Bootstrap build
run: ./bootstrap-linux.sh
# MSVC bootstrap disabled — see COMPATIBILITY.md (NRVO limitation)
# - name: Generate MSVC bootstrap script
# run: |
# cp configs/msvc.config build/tup.config
# CONFIG=msvc ./build/putup show script -B build > build/bootstrap-msvc.bat
# cp configs/linux.config build/tup.config
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: build-linux
path: build/
build-macos:
needs: format-check
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Bootstrap build
run: ./bootstrap-macos.sh
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: build-macos
path: build/
# MSVC build disabled — NRVO limitation causes stale StringPool pointers.
# See COMPATIBILITY.md for details.
# build-windows-msvc:
# needs: build-linux
# runs-on: windows-latest
# steps:
# - uses: actions/checkout@v4
# - name: Download pre-generated bootstrap script
# uses: actions/download-artifact@v4
# with:
# name: build-linux
# path: artifacts/
# - name: Setup MSVC build
# run: |
# mkdir -p build
# cp configs/msvc.config build/tup.config
# cp artifacts/bootstrap-msvc.bat .
# shell: bash
# - uses: ilammy/msvc-dev-cmd@v1
# - name: Bootstrap build
# shell: cmd
# run: bootstrap-msvc.bat
# - name: Upload build artifacts
# uses: actions/upload-artifact@v4
# with:
# name: build-windows-msvc
# path: build/
build-windows-mingw:
needs: format-check
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v4
- uses: msys2/setup-msys2@v2
with:
msystem: UCRT64
install: mingw-w64-ucrt-x86_64-gcc make
- name: Bootstrap build
run: ./bootstrap-mingw.sh
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: build-windows-mingw
path: build/
test-linux:
needs: build-linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: build-linux
path: build/
- name: Fix permissions
run: chmod +x build/putup build/test/unit/putup_test
- name: Run tests
run: ./build/test/unit/putup_test
test-macos:
needs: build-macos
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: build-macos
path: build/
- name: Fix permissions
run: chmod +x build/putup build/test/unit/putup_test
- name: Run tests
run: ./build/test/unit/putup_test
# MSVC tests disabled — see build-windows-msvc comment above.
# test-windows-msvc:
# needs: build-windows-msvc
# runs-on: windows-latest
# steps:
# - uses: actions/checkout@v4
# - name: Download build artifacts
# uses: actions/download-artifact@v4
# with:
# name: build-windows-msvc
# path: build/
# - name: Run tests
# run: .\build\test\unit\putup_test.exe
# env:
# PUP: .\build\putup.exe
test-windows-mingw:
needs: build-windows-mingw
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: build-windows-mingw
path: build/
- name: Run tests
run: ./build/test/unit/putup_test.exe "~[e2e]~[shell]"
env:
PUP: ./build/putup.exe
tidy:
needs: build-linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: build-linux
path: build/
- name: Fix permissions
run: chmod +x build/putup
- name: Run clang-tidy
run: make tidy PUTUP=./build/putup RUN_CLANG_TIDY=run-clang-tidy-18
build-gcc-bsp:
needs: build-linux
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: build-linux
path: build/
- name: Fix permissions
run: chmod +x build/putup
- name: Download source
working-directory: examples/bsp
run: scripts/download-source.sh ../../source-root
- name: Configure
working-directory: examples/bsp
run: ../../build/putup configure --config configs/x86_64-linux.config -C . -S ../../source-root -B ../../build-gcc
- name: Build
working-directory: examples/bsp
run: ../../build/putup -C . -S ../../source-root -B ../../build-gcc -j$(nproc)
- name: Smoke test cc1
run: |
echo 'int main() { return 0; }' > /tmp/test.c
build-gcc/gcc/gcc/cc1 /tmp/test.c -quiet -o /tmp/test.s
grep 'GCC.*15.2.0' /tmp/test.s