.gitea/workflows/build-and-test: rewrite to debian native build
This commit is contained in:
@@ -3,61 +3,96 @@ on:
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
push:
|
||||
|
||||
env:
|
||||
BINSTALL_DISABLE_TELEMETRY: 'true'
|
||||
|
||||
jobs:
|
||||
build-shared-library:
|
||||
build-dynamic-library:
|
||||
runs-on: debian-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Install sudo
|
||||
run: apt-get update && apt-get -y install sudo
|
||||
- name: Install rust toolchain
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
components: rustfmt
|
||||
|
||||
- name: Install nix
|
||||
uses: https://github.com/cachix/install-nix-action@v31
|
||||
- name: Build
|
||||
run: cargo build --release
|
||||
|
||||
- name: Build
|
||||
run: nix build .#tamerye-shared-lib -L
|
||||
|
||||
- name: Upload database as artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: tamerye-shared-library-${{ gitea.sha }}.zip
|
||||
path: result/
|
||||
if-no-files-found: error
|
||||
retention-days: 15
|
||||
- name: Upload database as artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: tamerye-dynamic-library-${{ gitea.sha }}.zip
|
||||
path: target/release/*.so
|
||||
if-no-files-found: error
|
||||
retention-days: 15
|
||||
|
||||
build-static-library:
|
||||
runs-on: debian-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Install sudo
|
||||
run: apt-get update && apt-get -y install sudo
|
||||
- name: Install libsqlite3
|
||||
run: apt-get install --update --assume-yes libsqlite3-dev
|
||||
|
||||
- name: Install nix
|
||||
uses: https://github.com/cachix/install-nix-action@v31
|
||||
- name: Patch Cargo.toml to build static library
|
||||
run: sed -i 's/cdylib/staticlib/' Cargo.toml
|
||||
|
||||
- name: Build
|
||||
run: nix build .#tamerye-static-lib -L
|
||||
- name: Install rust toolchain
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
components: rustfmt
|
||||
|
||||
- name: Upload database as artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: tamerye-static-library-${{ gitea.sha }}.zip
|
||||
path: result/
|
||||
if-no-files-found: error
|
||||
retention-days: 15
|
||||
- name: Build
|
||||
run: cargo build --release --features static
|
||||
|
||||
- name: Upload database as artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: tamerye-static-library-${{ gitea.sha }}.zip
|
||||
path: target/release/*.a
|
||||
if-no-files-found: error
|
||||
retention-days: 15
|
||||
|
||||
check:
|
||||
runs-on: debian-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Install rust toolchain
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
components: rustfmt, clippy
|
||||
|
||||
- name: Check code format
|
||||
run: cargo fmt -- --check
|
||||
|
||||
- name: Check clippy
|
||||
run: cargo clippy -- --deny warnings
|
||||
|
||||
test:
|
||||
runs-on: debian-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Install sudo
|
||||
run: apt-get update && apt-get -y install sudo
|
||||
- name: Install libsqlite3
|
||||
run: apt-get install --update --assume-yes libsqlite3-dev
|
||||
|
||||
- name: Install nix
|
||||
uses: https://github.com/cachix/install-nix-action@v31
|
||||
- name: Patch Cargo.toml to build static library
|
||||
run: sed -i 's/cdylib/staticlib/' Cargo.toml
|
||||
|
||||
- name: Build
|
||||
run: nix build .#tamerye-tests -L
|
||||
- name: Install rust toolchain
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
|
||||
- name: Install cargo-binstall
|
||||
uses: cargo-bins/cargo-binstall@main
|
||||
|
||||
- name: Install nextest
|
||||
run: cargo binstall -y cargo-nextest --secure
|
||||
|
||||
- name: Run tests
|
||||
run: cargo nextest run --release --no-fail-fast --features static
|
||||
env:
|
||||
RUST_LOG: "trace"
|
||||
|
||||
Reference in New Issue
Block a user