Skip to content

chore(deps): bump the cargo group in /src-tauri with 2 updates #239

chore(deps): bump the cargo group in /src-tauri with 2 updates

chore(deps): bump the cargo group in /src-tauri with 2 updates #239

Workflow file for this run

name: CI
on:
pull_request:
branches: [main]
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
deps-age:
name: Dependency Age Gate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: '20'
cache: 'npm'
- name: Install npm dependencies (for lockfile resolution)
run: npm ci
- name: Check dependency ages
run: npm run deps:check
lint-ts:
name: Lint (TypeScript)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: TypeScript lint
run: npm run lint
- name: TypeScript type check
run: npm run type-check
lint-rust:
name: Lint (Rust)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
with:
workspaces: src-tauri
- name: Install system dependencies
uses: awalsh128/cache-apt-pkgs-action@681749ae568c81c2037cb9185e38b709b261bd2f # v1.6.1
with:
packages: libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
version: 1.0
- name: Rust format check
run: cargo fmt --all -- --check
working-directory: src-tauri
- name: Rust clippy
run: cargo clippy --all-targets --all-features -- -D warnings
working-directory: src-tauri
test-rust:
name: Test Rust
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: test_root_password
MYSQL_DATABASE: test_db
MYSQL_USER: test_user
MYSQL_PASSWORD: test_password
ports:
- 13306:3306
options: >-
--health-cmd "mysqladmin ping -h localhost"
--health-interval 10s
--health-timeout 5s
--health-retries 10
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
with:
workspaces: src-tauri
- name: Seed test database
run: mysql -h 127.0.0.1 -P 13306 -u root -ptest_root_password < tests/fixtures/sql/seed.sql
- name: Install cargo-tarpaulin
run: cargo install cargo-tarpaulin --locked
- name: Run Rust tests with coverage
run: cargo tarpaulin -p mas-core -p mas-export -p mas-admin --out Lcov --output-dir coverage/
working-directory: src-tauri
- name: Upload Rust coverage to Codecov
uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: rust
files: src-tauri/coverage/lcov.info
fail_ci_if_error: false
test-frontend:
name: Test Frontend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run unit tests
run: npm run test:unit -- --coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: frontend
files: coverage/lcov.info
fail_ci_if_error: false
- name: Upload coverage artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: frontend-coverage
path: coverage/
test-e2e:
name: E2E Tests
runs-on: ubuntu-latest
needs: [test-rust, test-frontend]
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: '20'
cache: 'npm'
- name: Install system dependencies
uses: awalsh128/cache-apt-pkgs-action@681749ae568c81c2037cb9185e38b709b261bd2f # v1.6.1
with:
packages: libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
version: 1.0
- name: Start test databases
run: docker compose -f docker-compose.test.yml up -d
- name: Wait for databases
run: |
echo "Waiting for MySQL 8..."
timeout 60 bash -c 'until docker exec mas-mysql-8 mysqladmin ping -h localhost -u root -ptest_root_password 2>/dev/null; do sleep 2; done' || echo "WARNING: MySQL 8 did not become ready"
echo "Waiting for MySQL 5.7..."
timeout 60 bash -c 'until docker exec mas-mysql-57 mysqladmin ping -h localhost -u root -ptest_root_password 2>/dev/null; do sleep 2; done' || echo "WARNING: MySQL 5.7 did not become ready"
echo "Waiting for MariaDB..."
timeout 60 bash -c 'until docker exec mas-mariadb-11 mariadb-admin ping -h localhost -u root -ptest_root_password 2>/dev/null; do sleep 2; done' || echo "WARNING: MariaDB did not become ready"
echo "Database wait complete"
- name: Install dependencies
run: npm ci
- name: Install Playwright
run: npx playwright install --with-deps chromium
- name: Build application
run: npm run build
- name: Run E2E tests
run: npm run test:e2e
env:
TEST_MYSQL8_URL: "mysql://test_user:test_password@127.0.0.1:13306/test_db"
TEST_MYSQL57_URL: "mysql://test_user:test_password@127.0.0.1:13307/test_db"
TEST_MARIADB_URL: "mysql://test_user:test_password@127.0.0.1:13308/test_db"
- name: Upload test results
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: e2e-results
path: |
playwright-report/
test-results/
- name: Stop test databases
if: always()
run: docker compose -f docker-compose.test.yml down -v