Some checks failed
PR Review Automation / review (pull_request) Has been cancelled
Test / rust-clippy (pull_request) Has been cancelled
Test / rust-fmt-check (pull_request) Has been cancelled
Test / frontend-tests (pull_request) Has been cancelled
Test / rust-tests (pull_request) Has been cancelled
Test / frontend-typecheck (pull_request) Has been cancelled
tauri-plugin-stronghold pulls in libsodium-sys-stable which panics at build time if libsodium is not found via pkg-config — it does not compile from source. All builder images and the test job inline apt installs were missing libsodium-dev, breaking every Rust compilation step. - Add libsodium-dev to Dockerfile.linux-amd64 - Add libsodium-dev (host) + libsodium-dev:arm64 (cross target) to Dockerfile.linux-arm64 - Add libsodium-dev to all three Rust jobs in test.yml - Add inline apt-get install to linux-amd64 and linux-arm64 Build steps in auto-tag.yml and release-beta.yml (bridges the timing race between build-images and auto-tag triggering on the same push) - Add SODIUM_LIB_DIR + SODIUM_STATIC to Windows Build env (Dockerfile already pre-builds libsodium; this tells the crate where to find it)
203 lines
7.2 KiB
YAML
203 lines
7.2 KiB
YAML
name: Test
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
- beta
|
|
pull_request:
|
|
|
|
jobs:
|
|
rust-fmt-check:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: rustlang/rust:nightly
|
|
steps:
|
|
- name: Checkout
|
|
run: |
|
|
set -eux
|
|
git init
|
|
git remote add origin https://gogs.tftsr.com/sarman/tftsr-devops_investigation.git
|
|
if [ -n "${GITHUB_SHA:-}" ] && git fetch --depth=1 origin "$GITHUB_SHA"; then
|
|
echo "Fetched commit SHA: $GITHUB_SHA"
|
|
elif [ -n "${GITHUB_REF_NAME:-}" ] && git fetch --depth=1 origin "$GITHUB_REF_NAME"; then
|
|
echo "Fetched ref name: $GITHUB_REF_NAME"
|
|
elif [ -n "${GITHUB_REF:-}" ]; then
|
|
REF_NAME="${GITHUB_REF#refs/heads/}"
|
|
git fetch --depth=1 origin "$REF_NAME"
|
|
echo "Fetched ref from GITHUB_REF: $REF_NAME"
|
|
else
|
|
git fetch --depth=1 origin master
|
|
echo "Fetched fallback ref: master"
|
|
fi
|
|
git checkout FETCH_HEAD
|
|
- name: Install Node.js
|
|
run: |
|
|
apt-get update && apt-get install -y curl
|
|
curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
|
|
apt-get install -y nodejs
|
|
- name: Install system dependencies
|
|
run: |
|
|
apt-get update && apt-get install -y \
|
|
libwebkit2gtk-4.1-dev \
|
|
libssl-dev \
|
|
libgtk-3-dev \
|
|
libayatana-appindicator3-dev \
|
|
librsvg2-dev \
|
|
libdbus-1-dev \
|
|
libsodium-dev \
|
|
pkg-config
|
|
- name: Install Rust components
|
|
run: rustup component add rustfmt
|
|
- name: Install dependencies
|
|
run: npm install --legacy-peer-deps
|
|
- name: Update version from Git
|
|
run: node scripts/update-version.mjs
|
|
- run: cargo generate-lockfile --manifest-path src-tauri/Cargo.toml
|
|
- run: cargo fmt --manifest-path src-tauri/Cargo.toml --check
|
|
|
|
rust-clippy:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: rustlang/rust:nightly
|
|
steps:
|
|
- name: Checkout
|
|
run: |
|
|
set -eux
|
|
git init
|
|
git remote add origin https://gogs.tftsr.com/sarman/tftsr-devops_investigation.git
|
|
if [ -n "${GITHUB_SHA:-}" ] && git fetch --depth=1 origin "$GITHUB_SHA"; then
|
|
echo "Fetched commit SHA: $GITHUB_SHA"
|
|
elif [ -n "${GITHUB_REF_NAME:-}" ] && git fetch --depth=1 origin "$GITHUB_REF_NAME"; then
|
|
echo "Fetched ref name: $GITHUB_REF_NAME"
|
|
elif [ -n "${GITHUB_REF:-}" ]; then
|
|
REF_NAME="${GITHUB_REF#refs/heads/}"
|
|
git fetch --depth=1 origin "$REF_NAME"
|
|
echo "Fetched ref from GITHUB_REF: $REF_NAME"
|
|
else
|
|
git fetch --depth=1 origin master
|
|
echo "Fetched fallback ref: master"
|
|
fi
|
|
git checkout FETCH_HEAD
|
|
- name: Install system dependencies
|
|
run: |
|
|
apt-get update && apt-get install -y \
|
|
libwebkit2gtk-4.1-dev \
|
|
libssl-dev \
|
|
libgtk-3-dev \
|
|
libayatana-appindicator3-dev \
|
|
librsvg2-dev \
|
|
libdbus-1-dev \
|
|
libsodium-dev \
|
|
pkg-config
|
|
- name: Install clippy
|
|
run: rustup component add clippy
|
|
- run: cargo clippy --manifest-path src-tauri/Cargo.toml -- -D warnings
|
|
|
|
rust-tests:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: rustlang/rust:nightly
|
|
steps:
|
|
- name: Checkout
|
|
run: |
|
|
set -eux
|
|
git init
|
|
git remote add origin https://gogs.tftsr.com/sarman/tftsr-devops_investigation.git
|
|
if [ -n "${GITHUB_SHA:-}" ] && git fetch --depth=1 origin "$GITHUB_SHA"; then
|
|
echo "Fetched commit SHA: $GITHUB_SHA"
|
|
elif [ -n "${GITHUB_REF_NAME:-}" ] && git fetch --depth=1 origin "$GITHUB_REF_NAME"; then
|
|
echo "Fetched ref name: $GITHUB_REF_NAME"
|
|
elif [ -n "${GITHUB_REF:-}" ]; then
|
|
REF_NAME="${GITHUB_REF#refs/heads/}"
|
|
git fetch --depth=1 origin "$REF_NAME"
|
|
echo "Fetched ref from GITHUB_REF: $REF_NAME"
|
|
else
|
|
git fetch --depth=1 origin master
|
|
echo "Fetched fallback ref: master"
|
|
fi
|
|
git checkout FETCH_HEAD
|
|
- name: Install system dependencies
|
|
run: |
|
|
apt-get update && apt-get install -y \
|
|
libwebkit2gtk-4.1-dev \
|
|
libssl-dev \
|
|
libgtk-3-dev \
|
|
libayatana-appindicator3-dev \
|
|
librsvg2-dev \
|
|
libdbus-1-dev \
|
|
libsodium-dev \
|
|
pkg-config
|
|
- run: cargo test --manifest-path src-tauri/Cargo.toml -- --test-threads=1
|
|
|
|
- name: Run shell module tests
|
|
run: 'cargo test --manifest-path src-tauri/Cargo.toml "shell::" -- --test-threads=1'
|
|
|
|
frontend-typecheck:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: node:22-alpine
|
|
steps:
|
|
- name: Checkout
|
|
run: |
|
|
set -eux
|
|
apk add --no-cache git
|
|
git init
|
|
git remote add origin https://gogs.tftsr.com/sarman/tftsr-devops_investigation.git
|
|
if [ -n "${GITHUB_SHA:-}" ] && git fetch --depth=1 origin "$GITHUB_SHA"; then
|
|
echo "Fetched commit SHA: $GITHUB_SHA"
|
|
elif [ -n "${GITHUB_REF_NAME:-}" ] && git fetch --depth=1 origin "$GITHUB_REF_NAME"; then
|
|
echo "Fetched ref name: $GITHUB_REF_NAME"
|
|
elif [ -n "${GITHUB_REF:-}" ]; then
|
|
REF_NAME="${GITHUB_REF#refs/heads/}"
|
|
git fetch --depth=1 origin "$REF_NAME"
|
|
echo "Fetched ref from GITHUB_REF: $REF_NAME"
|
|
else
|
|
git fetch --depth=1 origin master
|
|
echo "Fetched fallback ref: master"
|
|
fi
|
|
git checkout FETCH_HEAD
|
|
- name: Cache npm
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ~/.npm
|
|
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-npm-
|
|
- run: npm ci --legacy-peer-deps
|
|
- run: npx tsc --noEmit
|
|
|
|
frontend-tests:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: node:22-alpine
|
|
steps:
|
|
- name: Checkout
|
|
run: |
|
|
set -eux
|
|
apk add --no-cache git
|
|
git init
|
|
git remote add origin https://gogs.tftsr.com/sarman/tftsr-devops_investigation.git
|
|
if [ -n "${GITHUB_SHA:-}" ] && git fetch --depth=1 origin "$GITHUB_SHA"; then
|
|
echo "Fetched commit SHA: $GITHUB_SHA"
|
|
elif [ -n "${GITHUB_REF_NAME:-}" ] && git fetch --depth=1 origin "$GITHUB_REF_NAME"; then
|
|
echo "Fetched ref name: $GITHUB_REF_NAME"
|
|
elif [ -n "${GITHUB_REF:-}" ]; then
|
|
REF_NAME="${GITHUB_REF#refs/heads/}"
|
|
git fetch --depth=1 origin "$REF_NAME"
|
|
echo "Fetched ref from GITHUB_REF: $REF_NAME"
|
|
else
|
|
git fetch --depth=1 origin master
|
|
echo "Fetched fallback ref: master"
|
|
fi
|
|
git checkout FETCH_HEAD
|
|
- name: Cache npm
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ~/.npm
|
|
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-npm-
|
|
- run: npm ci --legacy-peer-deps
|
|
- run: npm run test:run
|