gitbutler/.github/workflows/push.yaml
2023-06-02 14:31:35 +02:00

169 lines
4.8 KiB
YAML

name: "Test"
on: [push]
jobs:
lint-frontend:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 7.x.x
run_install: |
args: ["--frozen-lockfile"]
- name: Lint frontend
run: |
pnpm lint
check-frontend:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 7.x.x
run_install: |
args: ["--frozen-lockfile"]
- name: check frontend
run: |
pnpm check
lint-rust:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install latest stable rust
uses: actions-rs/toolchain@v1
with:
override: true
toolchain: stable
components: rustfmt
- run: cargo fmt --check
working-directory: src-tauri
story:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 7.x.x
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install pnpm dependencies
run: pnpm install
- name: Build storybook
run: pnpm story:build
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 7.x.x
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install pnpm dependencies
run: pnpm install
- name: Install latest stable rust
uses: actions-rs/toolchain@v1
with:
override: true
toolchain: stable
components: rustfmt, clippy
- name: Cache rust dependencies
uses: Swatinem/rust-cache@v2
with:
workspaces: src-tauri
- run: sudo apt-get update
if: runner.os == 'Linux'
- name: Install system dependencies
uses: daaku/gh-action-apt-install@v4
if: 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
run: pnpm build
- name: Install clippy
run: rustup component add clippy
- run: cargo clippy --all-features
working-directory: src-tauri
- name: Test rust
working-directory: src-tauri
run: cargo test