73 lines
1.5 KiB
YAML
73 lines
1.5 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
|
|
jobs:
|
|
nro:
|
|
name: Build NRO
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: devkitpro/devkita64:latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Configure
|
|
run: cmake --preset switch
|
|
|
|
- name: Build
|
|
run: cmake --build build -j$(nproc)
|
|
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: NXST-${{ github.sha }}
|
|
path: build/NXST.nro
|
|
|
|
release:
|
|
name: Upload release asset
|
|
runs-on: ubuntu-latest
|
|
needs: nro
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
steps:
|
|
- uses: actions/download-artifact@v4
|
|
with:
|
|
name: NXST-${{ github.sha }}
|
|
|
|
- uses: softprops/action-gh-release@v2
|
|
with:
|
|
files: NXST.nro
|
|
|
|
format:
|
|
name: Format check
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install clang-format
|
|
run: sudo apt-get update && sudo apt-get install -y clang-format
|
|
|
|
- name: Check formatting
|
|
run: |
|
|
find src include \( -name '*.cpp' -o -name '*.hpp' \) \
|
|
| xargs clang-format --dry-run --Werror
|
|
|
|
layering:
|
|
name: Layering check
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: UI must not include net/sys headers
|
|
run: |
|
|
! grep -rE '^#include\s*[<"](arpa/inet|sys/socket|pthread)' src/ui/
|