mirror of
https://github.com/Xevion/byte-me.git
synced 2026-01-31 02:23:47 -06:00
ci: build backend properly, matrix target all major platforms, artifact upload
This commit is contained in:
Vendored
+35
-15
@@ -13,7 +13,28 @@ env:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
name: Build (${{ matrix.os }}${{ matrix.target && format(' / {0}', matrix.target) || '' }})
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- os: ubuntu-22.04
|
||||||
|
target: ""
|
||||||
|
artifact_name: byte-me-linux-x86_64
|
||||||
|
artifact_path: src-tauri/target/x86_64-unknown-linux-gnu/release/byte-me
|
||||||
|
- os: windows-latest
|
||||||
|
target: ""
|
||||||
|
artifact_name: byte-me-windows-x86_64
|
||||||
|
artifact_path: src-tauri/target/x86_64-pc-windows-msvc/release/byte-me.exe
|
||||||
|
- os: macos-latest
|
||||||
|
target: aarch64-apple-darwin
|
||||||
|
artifact_name: byte-me-macos-aarch64
|
||||||
|
artifact_path: src-tauri/target/aarch64-apple-darwin/release/byte-me
|
||||||
|
- os: macos-latest
|
||||||
|
target: x86_64-apple-darwin
|
||||||
|
artifact_name: byte-me-macos-x86_64
|
||||||
|
artifact_path: src-tauri/target/x86_64-apple-darwin/release/byte-me
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -23,6 +44,7 @@ jobs:
|
|||||||
uses: dtolnay/rust-toolchain@stable
|
uses: dtolnay/rust-toolchain@stable
|
||||||
with:
|
with:
|
||||||
components: rustfmt, clippy
|
components: rustfmt, clippy
|
||||||
|
targets: ${{ matrix.target }}
|
||||||
|
|
||||||
- name: Install sccache
|
- name: Install sccache
|
||||||
uses: taiki-e/install-action@sccache
|
uses: taiki-e/install-action@sccache
|
||||||
@@ -54,6 +76,7 @@ jobs:
|
|||||||
run: pnpm install --frozen-lockfile --prefer-offline
|
run: pnpm install --frozen-lockfile --prefer-offline
|
||||||
|
|
||||||
- name: Install Linux dependencies
|
- name: Install Linux dependencies
|
||||||
|
if: runner.os == 'Linux'
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y --no-install-recommends \
|
sudo apt-get install -y --no-install-recommends \
|
||||||
@@ -65,22 +88,19 @@ jobs:
|
|||||||
librsvg2-dev \
|
librsvg2-dev \
|
||||||
patchelf
|
patchelf
|
||||||
|
|
||||||
# this will run again in next step, but we run it here to separate the error from the frontend build step
|
- name: Build app (tauri - host)
|
||||||
- name: Generate frontend bindings
|
if: matrix.target == ''
|
||||||
run: pnpm run generate-types
|
run: pnpm tauri build
|
||||||
|
|
||||||
- name: Build frontend (tsc + vite)
|
- name: Build app (tauri - target)
|
||||||
run: |
|
if: matrix.target != ''
|
||||||
pnpm run build # implicitly runs generate-types
|
run: pnpm tauri build --target ${{ matrix.target }}
|
||||||
|
|
||||||
- name: Format check
|
- name: Upload binary artifact
|
||||||
run: cargo fmt --manifest-path src-tauri/Cargo.toml --all -- --check
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
- name: Clippy
|
name: ${{ matrix.artifact_name }}
|
||||||
run: cargo clippy --manifest-path src-tauri/Cargo.toml --all-targets --all-features -- -D warnings
|
path: ${{ matrix.artifact_path }}
|
||||||
|
|
||||||
- name: Run tests
|
|
||||||
run: cargo test --manifest-path src-tauri/Cargo.toml --all-features
|
|
||||||
|
|
||||||
- name: sccache stats
|
- name: sccache stats
|
||||||
if: always()
|
if: always()
|
||||||
|
|||||||
Reference in New Issue
Block a user