chore: remove chat-test for compilation #56
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build | |
on: | |
push: | |
branches: | |
- master | |
tags: | |
- v* | |
pull_request: | |
branches: | |
- master | |
permissions: | |
contents: write | |
env: | |
SUBDIRS: chat swiftide-pgvector chatapp/src-tauri | |
jobs: | |
build-rust: | |
strategy: | |
matrix: | |
platform: [ubuntu-latest] | |
runs-on: ${{ matrix.platform }} | |
services: | |
postgres: | |
image: postgres:14.5 | |
env: | |
POSTGRES_PASSWORD: postgres | |
ports: | |
- 5432:5432 | |
# Set health checks to wait until postgres has started | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: recursive | |
- name: Install Protoc | |
uses: arduino/setup-protoc@v3 | |
- name: install dependencies | |
run: | | |
sudo apt-get update | |
# see https://github.com/tauri-apps/tauri/issues/3701 | |
sudo apt-get install -y javascriptcoregtk-4.1 libsoup-3.0 webkit2gtk-4.1 pkg-config libssl-dev | |
# sudo apt-get install libgtk-3-dev | |
# sudo apt-get install libsoup-3.0-dev | |
- name: Install Rust | |
run: rustup toolchain install stable --component llvm-tools-preview | |
- name: Install cargo-llvm-cov | |
uses: taiki-e/install-action@cargo-llvm-cov | |
- name: install nextest | |
uses: taiki-e/install-action@nextest | |
- uses: Swatinem/rust-cache@v2 | |
- name: Check code format | |
run: | | |
for dir in ${{ env.SUBDIRS }}; do | |
cd $dir | |
cargo fmt --all -- --check | |
cd .. | |
done | |
- name: Check the package for errors | |
run: | | |
for dir in ${{ env.SUBDIRS }}; do | |
cd $dir | |
cargo check --all | |
cd .. | |
done | |
- name: Lint rust sources | |
run: | | |
for dir in ${{ env.SUBDIRS }}; do | |
cd $dir | |
cargo clippy --all-targets --all-features --tests --benches -- -D warnings | |
cd .. | |
done | |
- name: Execute rust tests | |
run: | | |
for dir in ${{ env.SUBDIRS }}; do | |
cd $dir | |
cargo nextest run --all-features | |
cd .. | |
done | |
- name: Generate a changelog | |
uses: orhun/git-cliff-action@v2 | |
id: git-cliff | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
config: cliff.toml | |
args: -vv --latest --strip header | |
env: | |
OUTPUT: CHANGES.md | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
body: ${{ steps.git-cliff.outputs.content }} |