Skip to content

Issues vol.2

Issues vol.2 #41

Workflow file for this run

name: 'test-build'
# This should ensure that the workflow won't run on `dev-*` branches, but will
# otherwise execute on any other branch and any pull request (including PRs
# from dev branches).
on:
push:
branches-ignore:
- 'dev-*'
pull_request:
branches:
- '*'
env:
RUST_VERSION: "1.72.0"
NODE_VERSION: "18"
# To build on latest ubuntu, some more dependencies are missing.
# So for now (before we figure out what there are), we are using
# ubuntu 20.04 everywhere.
jobs:
# Check Rust code formatting.
formatting:
name: "Check Rust code formatting"
runs-on: ubuntu-20.04
env:
RUSTFLAGS: "-D warnings"
defaults:
run:
working-directory: ./src-tauri
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.RUST_VERSION }}
components: rustfmt
- run: cargo fmt --all -- --check
# Check Rust code validity.
validity:
needs: formatting
name: "Check Rust code validity"
runs-on: ubuntu-20.04
env:
RUSTFLAGS: "-D warnings"
defaults:
run:
working-directory: ./src-tauri
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.RUST_VERSION }}
- name: install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
- run: cargo check --all-features
# Run all tests in the Rust project (if any).
test:
needs: validity
name: "Run Rust test suite"
runs-on: ubuntu-20.04
env:
RUSTFLAGS: "-D warnings"
defaults:
run:
working-directory: ./src-tauri
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.RUST_VERSION }}
components: rustfmt
- name: install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
- run: cargo test --all-features
# Check Rust code style with clippy.
clippy:
needs: validity
name: "Check Rust code using clippy"
runs-on: ubuntu-20.04
env:
RUSTFLAGS: "-D warnings"
defaults:
run:
working-directory: ./src-tauri
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.RUST_VERSION }}
components: clippy
- name: install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
- run: cargo clippy --all-features
# Try to build the app on all platforms to make sure there is nothing
# wrong with the frontend integration and tauri config in general.
test-build:
name: "Multiplatform build"
strategy:
fail-fast: false
matrix:
platform: [macos-latest, ubuntu-20.04, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v3
- name: setup node
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.RUST_VERSION }}
- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-20.04'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
- name: install tauri
run: npm install
- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}