finish refactor, add docs and CI
This commit is contained in:
@@ -0,0 +1,93 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
nro:
|
||||
name: Build NRO
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
run: |
|
||||
git clone --recurse-submodules "${{ gitea.server_url }}/${{ gitea.repository }}" .
|
||||
git checkout "${{ gitea.sha }}"
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
docker run --rm \
|
||||
-v "$PWD:/workspace" -w /workspace \
|
||||
devkitpro/devkita64:latest \
|
||||
bash -c "cmake --preset switch && cmake --build build -j\$(nproc)"
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: NXST-${{ gitea.sha }}
|
||||
path: build/NXST.nro
|
||||
|
||||
release:
|
||||
name: Upload release asset
|
||||
runs-on: ubuntu-latest
|
||||
needs: nro
|
||||
if: startsWith(gitea.ref, 'refs/tags/v')
|
||||
|
||||
steps:
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: NXST-${{ gitea.sha }}
|
||||
|
||||
- name: Create Gitea release and upload NRO
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||
TAG: ${{ gitea.ref_name }}
|
||||
API: ${{ gitea.server_url }}/api/v1
|
||||
REPO: ${{ gitea.repository }}
|
||||
run: |
|
||||
release_id=$(curl -sf -X POST "$API/repos/$REPO/releases" \
|
||||
-H "Authorization: token $GITEA_TOKEN" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"tag_name\": \"$TAG\", \"name\": \"$TAG\"}" \
|
||||
| grep -o '"id":[0-9]*' | head -1 | cut -d: -f2)
|
||||
|
||||
curl -sf -X POST "$API/repos/$REPO/releases/$release_id/assets?name=NXST.nro" \
|
||||
-H "Authorization: token $GITEA_TOKEN" \
|
||||
-H "Content-Type: application/octet-stream" \
|
||||
--data-binary @NXST.nro
|
||||
|
||||
format:
|
||||
name: Format check
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
run: |
|
||||
git clone "${{ gitea.server_url }}/${{ gitea.repository }}" .
|
||||
git checkout "${{ gitea.sha }}"
|
||||
|
||||
- name: Install clang-format
|
||||
run: |
|
||||
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
|
||||
echo "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-22 main" | sudo tee /etc/apt/sources.list.d/llvm.list
|
||||
sudo apt-get update && sudo apt-get install -y clang-format-22
|
||||
sudo ln -sf /usr/bin/clang-format-22 /usr/local/bin/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:
|
||||
- name: Checkout
|
||||
run: |
|
||||
git clone "${{ gitea.server_url }}/${{ gitea.repository }}" .
|
||||
git checkout "${{ gitea.sha }}"
|
||||
|
||||
- name: UI must not include net/sys headers
|
||||
run: |
|
||||
! grep -rE '^#include\s*[<"](arpa/inet|sys/socket|pthread)' src/ui/
|
||||
Reference in New Issue
Block a user