86 lines
2.7 KiB
YAML
86 lines
2.7 KiB
YAML
# Gitea selects .gitea/workflows before .github/workflows. Keep the inherited
|
|
# push/PR checks active here; the existing GitHub workflows remain independent.
|
|
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
|
|
permissions:
|
|
code: read
|
|
|
|
env:
|
|
RUSTUP_TOOLCHAIN: nightly-2026-11-24
|
|
|
|
jobs:
|
|
check:
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
steps:
|
|
- uses: https://github.com/actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Install build dependencies
|
|
run: |
|
|
set -euo pipefail
|
|
sudo_cmd=()
|
|
if [ "$(id -u)" -ne 0 ]; then sudo_cmd=(sudo); fi
|
|
"${sudo_cmd[@]}" apt-get update
|
|
"${sudo_cmd[@]}" apt-get install -y ca-certificates curl build-essential cmake perl nasm pkg-config libcurl4-openssl-dev
|
|
|
|
- uses: https://github.com/dtolnay/rust-toolchain@df2a88e9fe4098bad09cb42c3dec7187f15861fc
|
|
with:
|
|
toolchain: ${{ env.RUSTUP_TOOLCHAIN }}
|
|
components: rustfmt, clippy
|
|
|
|
- name: Format
|
|
run: cargo fmt --check
|
|
|
|
- name: Clippy
|
|
run: cargo clippy --locked --all-targets --features vendored-lua -- -D warnings
|
|
|
|
- name: Test
|
|
run: cargo test --locked --features vendored-lua
|
|
|
|
windows:
|
|
if: gitea.event_name == 'push' && gitea.ref == 'refs/heads/main'
|
|
runs-on: windows-x64
|
|
defaults:
|
|
run:
|
|
shell: powershell
|
|
steps:
|
|
- uses: https://github.com/actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- uses: https://github.com/dtolnay/rust-toolchain@df2a88e9fe4098bad09cb42c3dec7187f15861fc
|
|
with:
|
|
toolchain: ${{ env.RUSTUP_TOOLCHAIN }}
|
|
targets: x86_64-pc-windows-msvc
|
|
|
|
- name: Build and verify Windows packages
|
|
id: stage
|
|
run: |
|
|
$dist = Join-Path $env:RUNNER_TEMP ([IO.Path]::GetRandomFileName())
|
|
New-Item -ItemType Directory -Path $dist | Out-Null
|
|
[IO.File]::AppendAllText($env:GITHUB_OUTPUT, "dist=$dist" + [Environment]::NewLine)
|
|
& .\packaging\windows\build.ps1 -OutputDirectory $dist
|
|
|
|
- uses: https://github.com/ChristopherHX/gitea-upload-artifact@81f940d004763f986ba3582c007fd842dd5cb0d7 # v4
|
|
with:
|
|
name: windows-packages
|
|
path: ${{ steps.stage.outputs.dist }}/*
|
|
if-no-files-found: error
|
|
compression-level: 0
|
|
retention-days: 1
|
|
|
|
- name: Remove temporary packages
|
|
if: always() && steps.stage.outputs.dist != ''
|
|
env:
|
|
DIST: ${{ steps.stage.outputs.dist }}
|
|
run: Remove-Item -LiteralPath $env:DIST -Recurse -Force
|