2022-04-25 12:52:37 +00:00
|
|
|
name: CI
|
2022-04-25 22:15:31 +00:00
|
|
|
|
2022-04-21 18:26:03 +00:00
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
branches:
|
2022-04-22 10:22:53 +00:00
|
|
|
- main
|
|
|
|
paths-ignore:
|
|
|
|
- '**/.md'
|
2022-05-04 12:57:04 +00:00
|
|
|
workflow_dispatch:
|
2022-04-25 22:15:31 +00:00
|
|
|
|
|
|
|
env:
|
2022-06-20 03:27:37 +00:00
|
|
|
SPACEDRIVE_CUSTOM_APT_FLAGS: --no-install-recommends
|
2022-04-21 18:26:03 +00:00
|
|
|
|
|
|
|
jobs:
|
2022-04-22 11:42:08 +00:00
|
|
|
typescript:
|
|
|
|
name: TypeScript
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
2022-06-03 08:19:59 +00:00
|
|
|
uses: actions/checkout@v3
|
2022-04-22 11:42:08 +00:00
|
|
|
|
|
|
|
- name: Install pnpm
|
2022-06-03 08:21:07 +00:00
|
|
|
uses: pnpm/action-setup@v2.2.2
|
2022-04-22 11:42:08 +00:00
|
|
|
with:
|
2022-05-01 04:33:42 +00:00
|
|
|
version: 7.x.x
|
2022-07-05 01:21:42 +00:00
|
|
|
|
2022-10-05 01:45:54 +00:00
|
|
|
- name: Install Node.js
|
|
|
|
uses: actions/setup-node@v3
|
2022-06-14 14:27:03 +00:00
|
|
|
with:
|
2022-12-14 09:43:02 +00:00
|
|
|
node-version: 18
|
2022-10-05 01:45:54 +00:00
|
|
|
cache: 'pnpm'
|
2022-07-05 01:21:42 +00:00
|
|
|
|
2022-06-14 14:27:03 +00:00
|
|
|
- name: Install pnpm dependencies
|
2022-10-05 01:45:54 +00:00
|
|
|
run: pnpm i --frozen-lockfile
|
2022-04-22 11:42:08 +00:00
|
|
|
|
2022-04-22 10:22:53 +00:00
|
|
|
- name: Perform typechecks
|
2022-05-15 09:35:12 +00:00
|
|
|
run: pnpm typecheck
|
2022-10-05 01:45:54 +00:00
|
|
|
|
2023-01-22 08:01:15 +00:00
|
|
|
eslint:
|
2023-01-22 08:11:02 +00:00
|
|
|
name: ESLint
|
2023-01-22 08:01:15 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Install pnpm
|
|
|
|
uses: pnpm/action-setup@v2.2.2
|
|
|
|
with:
|
|
|
|
version: 7.x.x
|
|
|
|
|
|
|
|
- name: Install Node.js
|
|
|
|
uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version: 18
|
|
|
|
cache: 'pnpm'
|
|
|
|
|
|
|
|
- name: Install pnpm dependencies
|
|
|
|
run: pnpm i --frozen-lockfile
|
|
|
|
|
2023-01-22 08:11:02 +00:00
|
|
|
- name: Perform linting
|
2023-01-22 08:01:15 +00:00
|
|
|
run: pnpm lint
|
|
|
|
|
2022-10-04 12:03:49 +00:00
|
|
|
rustfmt:
|
|
|
|
name: rustfmt
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Install Rust
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
components: rustfmt
|
|
|
|
|
2022-10-05 01:45:54 +00:00
|
|
|
- name: Cache Rust dependencies
|
|
|
|
uses: ./.github/actions/cache-rust-deps
|
|
|
|
|
|
|
|
- name: Generate Prisma client
|
|
|
|
uses: ./.github/actions/generate-prisma-client
|
|
|
|
|
2022-10-04 12:03:49 +00:00
|
|
|
- name: Run rustfmt
|
|
|
|
run: cargo fmt --all -- --check
|
2022-04-22 10:22:53 +00:00
|
|
|
|
2022-10-05 01:45:54 +00:00
|
|
|
clippy_check:
|
|
|
|
name: Clippy
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Install Rust
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
profile: minimal
|
|
|
|
override: true
|
|
|
|
components: clippy
|
|
|
|
|
|
|
|
- name: Cache Rust dependencies
|
|
|
|
uses: ./.github/actions/cache-rust-deps
|
|
|
|
|
|
|
|
- name: Install Node.js
|
|
|
|
uses: actions/setup-node@v3
|
|
|
|
with:
|
2022-12-14 09:43:02 +00:00
|
|
|
node-version: 18
|
2022-10-05 01:45:54 +00:00
|
|
|
|
|
|
|
- name: Install pnpm
|
|
|
|
uses: pnpm/action-setup@v2.0.1
|
|
|
|
with:
|
|
|
|
version: 7
|
|
|
|
run_install: false
|
|
|
|
|
|
|
|
- name: Run 'setup-system.sh' script
|
|
|
|
run: ./.github/scripts/setup-system.sh
|
|
|
|
|
|
|
|
- name: Generate Prisma client
|
|
|
|
uses: ./.github/actions/generate-prisma-client
|
|
|
|
|
|
|
|
- name: Run Clippy
|
|
|
|
uses: actions-rs/clippy-check@v1
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
args: --all-features --release
|
|
|
|
|
|
|
|
build-and-publish:
|
|
|
|
name: Build and Publish (${{ matrix.platform }})
|
2022-04-23 09:22:27 +00:00
|
|
|
runs-on: ${{ matrix.platform }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: true
|
|
|
|
matrix:
|
2022-04-25 22:15:31 +00:00
|
|
|
platform: [ubuntu-latest, macos-latest, windows-latest]
|
2022-04-21 18:26:03 +00:00
|
|
|
steps:
|
2022-06-14 14:27:03 +00:00
|
|
|
- name: Log in to the Container registry
|
|
|
|
if: matrix.platform == 'ubuntu-latest' && github.event_name != 'pull_request'
|
|
|
|
uses: docker/login-action@v1
|
2022-04-23 07:41:33 +00:00
|
|
|
with:
|
2022-06-14 14:27:03 +00:00
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.repository_owner }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
2022-04-23 07:41:33 +00:00
|
|
|
|
|
|
|
- name: Checkout repository
|
2022-06-03 08:19:59 +00:00
|
|
|
uses: actions/checkout@v3
|
2022-04-23 16:14:00 +00:00
|
|
|
|
2022-04-23 07:41:33 +00:00
|
|
|
- name: Install Rust stable
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
profile: minimal
|
|
|
|
override: true
|
|
|
|
components: rustfmt, rust-src
|
2022-07-05 01:21:42 +00:00
|
|
|
|
2022-10-05 01:45:54 +00:00
|
|
|
- name: Cache Rust dependencies
|
|
|
|
uses: ./.github/actions/cache-rust-deps
|
|
|
|
|
|
|
|
- name: Install pnpm
|
|
|
|
uses: pnpm/action-setup@v2.2.2
|
|
|
|
with:
|
|
|
|
version: 7.x.x
|
|
|
|
|
|
|
|
- name: Install Node.js
|
|
|
|
uses: actions/setup-node@v3
|
2022-04-23 09:22:27 +00:00
|
|
|
with:
|
2022-12-14 09:43:02 +00:00
|
|
|
node-version: 18
|
2022-10-05 01:45:54 +00:00
|
|
|
cache: 'pnpm'
|
|
|
|
|
|
|
|
- name: Install pnpm dependencies
|
|
|
|
run: pnpm i --frozen-lockfile
|
2022-04-23 07:41:33 +00:00
|
|
|
|
2022-06-14 14:27:03 +00:00
|
|
|
- name: Run 'setup-system.sh' script
|
|
|
|
if: matrix.platform == 'ubuntu-latest' || matrix.platform == 'macos-latest'
|
|
|
|
run: ./.github/scripts/setup-system.sh
|
2022-07-05 01:21:42 +00:00
|
|
|
|
2022-06-14 14:27:03 +00:00
|
|
|
- name: Run 'setup-system.ps1' script
|
|
|
|
if: matrix.platform == 'windows-latest'
|
2022-07-05 01:21:42 +00:00
|
|
|
run: ./.github/scripts/setup-system.ps1 -ci
|
2022-04-23 07:41:33 +00:00
|
|
|
|
2022-04-25 17:24:05 +00:00
|
|
|
- name: Generate Prisma client
|
2022-10-05 01:45:54 +00:00
|
|
|
uses: ./.github/actions/generate-prisma-client
|
2022-04-23 13:59:57 +00:00
|
|
|
|
2022-10-05 09:20:28 +00:00
|
|
|
- name: Cargo fetch
|
|
|
|
run: cargo fetch
|
|
|
|
|
2022-12-30 16:53:24 +00:00
|
|
|
- name: Cargo test core
|
|
|
|
run: cargo test -p sd-core -F location-watcher
|
|
|
|
|
2022-10-05 09:20:28 +00:00
|
|
|
- name: Check core
|
|
|
|
run: cargo check -p sd-core --release
|
2022-04-23 18:53:12 +00:00
|
|
|
|
2023-02-16 11:42:30 +00:00
|
|
|
- name: Cargo test sd-crypto
|
|
|
|
run: cargo test -p sd-crypto --release --lib --all-features
|
|
|
|
|
2022-06-14 14:27:03 +00:00
|
|
|
- name: Bundle Desktop
|
|
|
|
run: pnpm desktop tauri build
|
2022-05-01 01:48:35 +00:00
|
|
|
|
2022-10-05 01:45:54 +00:00
|
|
|
- name: Publish server Docker image
|
2022-06-14 14:27:03 +00:00
|
|
|
if: matrix.platform == 'ubuntu-latest' && github.event_name != 'pull_request'
|
2022-10-05 01:45:54 +00:00
|
|
|
uses: ./.github/actions/publish-server-image
|
2022-06-14 14:27:03 +00:00
|
|
|
|
|
|
|
- name: Publish artifacts
|
|
|
|
uses: ./.github/actions/publish-artifacts
|