2023-02-20 15:12:24 +03:00
|
|
|
name: "Test"
|
|
|
|
on: [push]
|
|
|
|
|
|
|
|
jobs:
|
2023-09-14 09:20:53 +03:00
|
|
|
lint-frontend:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
|
|
- uses: ./.github/actions/init-env
|
|
|
|
id: init
|
|
|
|
with:
|
|
|
|
runs-on: frontend
|
|
|
|
|
|
|
|
- name: Lint frontend
|
2023-09-14 09:28:55 +03:00
|
|
|
if: steps.init.outputs.frontend == 'true'
|
2023-09-14 09:20:53 +03:00
|
|
|
run: pnpm lint
|
|
|
|
|
|
|
|
check-frontend:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
|
|
- uses: ./.github/actions/init-env
|
|
|
|
id: init
|
|
|
|
with:
|
|
|
|
runs-on: frontend
|
|
|
|
|
|
|
|
- name: check frontend
|
2023-09-14 09:28:55 +03:00
|
|
|
if: steps.init.outputs.frontend == 'true'
|
2023-09-14 09:20:53 +03:00
|
|
|
run: pnpm check
|
|
|
|
|
|
|
|
unittest-frontend:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
|
|
- uses: ./.github/actions/init-env
|
|
|
|
id: init
|
|
|
|
with:
|
|
|
|
runs-on: frontend
|
|
|
|
|
|
|
|
- name: check frontend
|
2023-09-14 09:28:55 +03:00
|
|
|
if: steps.init.outputs.frontend == 'true'
|
2023-09-14 09:20:53 +03:00
|
|
|
run: pnpm test
|
|
|
|
|
|
|
|
lint-rust:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
|
|
- uses: ./.github/actions/init-env
|
|
|
|
id: init
|
|
|
|
with:
|
|
|
|
runs-on: backend
|
|
|
|
|
|
|
|
- name: Install latest stable rust
|
2023-09-14 09:28:55 +03:00
|
|
|
if: steps.init.outputs.backend == 'true'
|
2023-09-14 09:20:53 +03:00
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
override: true
|
|
|
|
toolchain: stable
|
|
|
|
components: rustfmt
|
|
|
|
|
|
|
|
- run: cargo fmt --check
|
2023-09-14 09:28:55 +03:00
|
|
|
if: steps.init.outputs.backend == 'true'
|
2023-09-14 09:20:53 +03:00
|
|
|
|
|
|
|
- run: cargo install cargo-sort
|
2023-09-14 09:28:55 +03:00
|
|
|
if: steps.init.outputs.backend == 'true'
|
2023-09-14 09:20:53 +03:00
|
|
|
|
|
|
|
- run: cargo sort --check --workspace
|
|
|
|
|
|
|
|
story:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
|
|
- uses: ./.github/actions/init-env
|
|
|
|
id: init
|
|
|
|
with:
|
|
|
|
runs-on: frontend
|
|
|
|
|
|
|
|
- name: Build storybook
|
2023-09-14 09:28:55 +03:00
|
|
|
if: steps.init.outputs.frontend == 'true'
|
2023-09-14 09:20:53 +03:00
|
|
|
run: pnpm story:build
|
|
|
|
|
|
|
|
test:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
|
|
- uses: ./.github/actions/init-env
|
|
|
|
id: init
|
|
|
|
with:
|
|
|
|
runs-on: backend
|
|
|
|
|
|
|
|
- name: Install latest stable rust
|
2023-09-14 09:28:55 +03:00
|
|
|
if: steps.init.outputs.backend == 'true'
|
2023-09-14 09:20:53 +03:00
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
override: true
|
|
|
|
toolchain: stable
|
|
|
|
components: rustfmt, clippy
|
|
|
|
|
|
|
|
- name: Cache rust dependencies
|
2023-09-14 09:28:55 +03:00
|
|
|
if: steps.init.outputs.backend == 'true'
|
2023-09-14 09:20:53 +03:00
|
|
|
uses: Swatinem/rust-cache@v2
|
|
|
|
|
|
|
|
- run: sudo apt-get update
|
2023-09-14 09:28:55 +03:00
|
|
|
if: steps.init.outputs.backend == 'true' && runner.os == 'Linux'
|
2023-09-14 09:20:53 +03:00
|
|
|
- name: Install system dependencies
|
|
|
|
uses: daaku/gh-action-apt-install@v4
|
2023-09-14 09:28:55 +03:00
|
|
|
if: steps.init.outputs.backend == 'true' && runner.os == 'Linux'
|
2023-09-14 09:20:53 +03:00
|
|
|
with:
|
|
|
|
# https://tauri.app/v1/guides/getting-started/prerequisites#setting-up-linux
|
|
|
|
packages: libwebkit2gtk-4.0-dev build-essential curl wget libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev
|
|
|
|
|
|
|
|
- name: Build frontend
|
2023-09-14 09:28:55 +03:00
|
|
|
if: steps.init.outputs.backend == 'true'
|
2023-09-14 09:20:53 +03:00
|
|
|
run: pnpm build
|
|
|
|
|
|
|
|
- name: Install clippy
|
2023-09-14 09:28:55 +03:00
|
|
|
if: steps.init.outputs.backend == 'true'
|
2023-09-14 09:20:53 +03:00
|
|
|
run: rustup component add clippy
|
|
|
|
|
|
|
|
- run: cargo clippy --all-features
|
2023-09-14 09:28:55 +03:00
|
|
|
if: steps.init.outputs.backend == 'true'
|
2023-09-14 09:20:53 +03:00
|
|
|
|
|
|
|
- name: Test rust
|
2023-09-14 09:28:55 +03:00
|
|
|
if: steps.init.outputs.backend == 'true'
|
2023-09-14 09:20:53 +03:00
|
|
|
run: cargo test --locked
|