gitbutler/.github/workflows/push.yaml
2023-08-17 20:20:38 +01:00

139 lines
4.0 KiB
YAML

name: "Test"
on: [push]
jobs:
lint-frontend:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: ./.github/actions/init-env
id: init
with:
runs-on: frontend
- name: Lint frontend
run: |
pnpm lint
check-frontend:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: ./.github/actions/init-env
id: init
with:
runs-on: frontend
- name: check frontend
run: |
pnpm check
unittest-frontend:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: ./.github/actions/init-env
id: init
with:
runs-on: frontend
- name: check frontend
run: |
pnpm test
lint-rust:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: ./.github/actions/init-env
id: init
with:
runs-on: backend
- name: Install latest stable rust
if: ${{ steps.init.outputs.backend == 'true' }}
uses: actions-rs/toolchain@v1
with:
override: true
toolchain: stable
components: rustfmt
- run: cargo fmt --check
if: ${{ steps.init.outputs.backend == 'true' }}
working-directory: src-tauri
story:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: ./.github/actions/init-env
id: init
with:
runs-on: frontend
- name: Build storybook
if: ${{ steps.init.outputs.frontend == 'true' }}
run: pnpm story:build
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: ./.github/actions/init-env
id: init
with:
runs-on: backend
- name: Install latest stable rust
if: ${{ steps.init.outputs.backend == 'true' }}
uses: actions-rs/toolchain@v1
with:
override: true
toolchain: stable
components: rustfmt, clippy
- name: Cache rust dependencies
if: ${{ steps.init.outputs.backend == 'true' }}
uses: Swatinem/rust-cache@v2
with:
workspaces: src-tauri
- run: sudo apt-get update
if: ${{ steps.init.outputs.backend == 'true' && runner.os == 'Linux' }}
- name: Install system dependencies
uses: daaku/gh-action-apt-install@v4
if: ${{ steps.init.outputs.backend == 'true' && runner.os == 'Linux' }}
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
if: ${{ steps.init.outputs.backend == 'true' }}
run: pnpm build
- name: Install clippy
if: ${{ steps.init.outputs.backend == 'true' }}
run: rustup component add clippy
- run: cargo clippy --all-features
if: ${{ steps.init.outputs.backend == 'true' }}
working-directory: src-tauri
- name: Test rust
if: ${{ steps.init.outputs.backend == 'true' }}
working-directory: src-tauri
run: cargo test --locked