gitbutler/.github/workflows/push.yaml

169 lines
4.8 KiB
YAML
Raw Normal View History

2023-02-20 15:12:24 +03:00
name: "Test"
on: [push]
jobs:
2023-05-31 10:35:32 +03:00
lint-frontend:
2023-02-27 12:50:57 +03:00
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"]
2023-03-07 19:11:49 +03:00
- name: Lint frontend
2023-02-27 12:50:57 +03:00
run: |
pnpm lint
2023-03-07 19:11:49 +03:00
2023-05-31 10:35:32 +03:00
check-frontend:
2023-03-07 19:11:49 +03:00
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: |
2023-02-27 12:50:57 +03:00
pnpm check
2023-05-31 10:35:32 +03:00
lint-rust:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
2023-06-02 15:02:39 +03:00
- name: Install latest stable rust
uses: actions-rs/toolchain@v1
with:
override: true
toolchain: stable
components: rustfmt
2023-05-31 10:35:32 +03:00
- run: cargo fmt --check
working-directory: src-tauri
2023-05-12 13:22:41 +03:00
story:
2023-02-20 16:04:26 +03:00
runs-on: ubuntu-latest
2023-02-20 15:12:24 +03:00
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18
2023-02-28 10:59:02 +03:00
- name: Install pnpm
2023-02-20 15:12:24 +03:00
uses: pnpm/action-setup@v2
with:
version: 7.x.x
2023-02-28 10:59:02 +03:00
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') }}
2023-05-12 13:22:41 +03:00
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') }}
2023-02-28 10:59:02 +03:00
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install pnpm dependencies
run: pnpm install
2023-02-20 15:12:24 +03:00
2023-06-02 15:02:39 +03:00
- name: Install latest stable rust
uses: actions-rs/toolchain@v1
with:
override: true
toolchain: stable
components: rustfmt, clippy
2023-02-20 16:14:28 +03:00
- name: Cache rust dependencies
2023-03-28 16:30:07 +03:00
uses: Swatinem/rust-cache@v2
2023-02-20 16:14:28 +03:00
with:
2023-03-28 16:30:07 +03:00
workspaces: src-tauri
2023-02-28 10:59:02 +03:00
2023-05-16 14:04:56 +03:00
- run: sudo apt-get update
if: runner.os == 'Linux'
2023-02-28 10:42:17 +03:00
- name: Install system dependencies
2023-02-20 16:14:28 +03:00
uses: daaku/gh-action-apt-install@v4
2023-02-28 10:42:17 +03:00
if: runner.os == 'Linux'
2023-02-20 16:14:28 +03:00
with:
2023-02-20 16:29:10 +03:00
# 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
2023-02-20 15:12:24 +03:00
2023-02-28 10:42:17 +03:00
- name: Build frontend
run: pnpm build
2023-02-20 16:41:52 +03:00
2023-05-31 10:35:32 +03:00
- name: Install clippy
run: rustup component add clippy
- run: cargo clippy --all-features
working-directory: src-tauri
2023-02-20 15:12:24 +03:00
- name: Test rust
working-directory: src-tauri
2023-02-28 10:42:17 +03:00
run: cargo test