167 lines
4 KiB
YAML
167 lines
4 KiB
YAML
name: Lint and Build
|
|
|
|
on:
|
|
push:
|
|
branches: [ "main" ]
|
|
pull_request:
|
|
branches: [ "main" ]
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: docker
|
|
container:
|
|
image: rust:latest
|
|
|
|
steps:
|
|
- name: Install Node.js
|
|
run: |
|
|
apt-get update && apt-get install -y curl
|
|
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
|
|
apt-get install -y nodejs
|
|
|
|
- uses: https://github.com/actions/checkout@v4
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
apt-get update && apt-get install -y pkg-config libssl-dev
|
|
|
|
- name: Install Rust components
|
|
run: |
|
|
rustup component add rustfmt clippy
|
|
|
|
- name: Run rustfmt (auto-fix)
|
|
working-directory: ./backend
|
|
run: cargo fmt --all
|
|
continue-on-error: true
|
|
|
|
- name: Check formatting
|
|
working-directory: ./backend
|
|
run: cargo fmt --all -- --check
|
|
continue-on-error: true
|
|
|
|
- name: Run clippy
|
|
working-directory: ./backend
|
|
run: cargo clippy --all-targets --all-features -- -W warnings
|
|
|
|
build:
|
|
runs-on: docker
|
|
container:
|
|
image: rust:latest
|
|
needs: lint
|
|
|
|
steps:
|
|
- name: Install Node.js
|
|
run: |
|
|
apt-get update && apt-get install -y curl
|
|
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
|
|
apt-get install -y nodejs
|
|
|
|
- uses: https://github.com/actions/checkout@v4
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
apt-get update && apt-get install -y pkg-config libssl-dev
|
|
|
|
- name: Build backend
|
|
working-directory: ./backend
|
|
run: cargo build --verbose
|
|
|
|
- name: Temporarily exclude integration tests
|
|
working-directory: ./backend
|
|
run: mv tests tests.disabled
|
|
|
|
- name: Run unit tests
|
|
working-directory: ./backend
|
|
run: cargo test --verbose
|
|
|
|
- name: Restore integration tests
|
|
working-directory: ./backend
|
|
run: mv tests.disabled tests
|
|
|
|
|
|
name: Lint and Build
|
|
|
|
on:
|
|
push:
|
|
branches: [ "main" ]
|
|
pull_request:
|
|
branches: [ "main" ]
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: docker
|
|
container:
|
|
image: rust:latest
|
|
|
|
steps:
|
|
- name: Install Node.js
|
|
run: |
|
|
apt-get update && apt-get install -y curl
|
|
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
|
|
apt-get install -y nodejs
|
|
|
|
- uses: https://github.com/actions/checkout@v4
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
apt-get update && apt-get install -y pkg-config libssl-dev
|
|
|
|
- name: Install Rust components
|
|
run: |
|
|
rustup component add rustfmt clippy
|
|
|
|
- name: Run rustfmt (auto-fix)
|
|
working-directory: ./backend
|
|
run: cargo fmt --all
|
|
continue-on-error: true
|
|
|
|
- name: Check formatting
|
|
working-directory: ./backend
|
|
run: cargo fmt --all -- --check
|
|
continue-on-error: true
|
|
|
|
- name: Run clippy
|
|
working-directory: ./backend
|
|
run: cargo clippy --all-targets --all-features -- -W warnings
|
|
|
|
build:
|
|
runs-on: docker
|
|
container:
|
|
image: rust:latest
|
|
needs: lint
|
|
|
|
steps:
|
|
- name: Install Node.js
|
|
run: |
|
|
apt-get update && apt-get install -y curl
|
|
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
|
|
apt-get install -y nodejs
|
|
|
|
- uses: https://github.com/actions/checkout@v4
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
apt-get update && apt-get install -y pkg-config libssl-dev
|
|
|
|
- name: Build backend
|
|
working-directory: ./backend
|
|
run: cargo build --verbose
|
|
|
|
- name: Temporarily exclude integration tests
|
|
working-directory: ./backend
|
|
run: mv tests tests.disabled
|
|
|
|
- name: Run unit tests
|
|
working-directory: ./backend
|
|
run: cargo test --verbose
|
|
|
|
- name: Restore integration tests
|
|
working-directory: ./backend
|
|
run: mv tests.disabled tests
|
|
|