fix(ci): create clean workflow without duplication
This commit is contained in:
parent
c03a499a19
commit
226cfab8a5
1 changed files with 15 additions and 75 deletions
|
|
@ -81,87 +81,27 @@ jobs:
|
||||||
working-directory: ./backend
|
working-directory: ./backend
|
||||||
run: mv tests.disabled tests
|
run: mv tests.disabled tests
|
||||||
|
|
||||||
|
docker-build:
|
||||||
name: Lint and Build
|
runs-on: docker
|
||||||
|
container:
|
||||||
on:
|
image: docker:cli
|
||||||
push:
|
|
||||||
branches: [ "main" ]
|
|
||||||
pull_request:
|
|
||||||
branches: [ "main" ]
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
CARGO_TERM_COLOR: always
|
DOCKER_HOST: tcp://docker-in-dinner:2375
|
||||||
|
DOCKER_TLS_CERTDIR: ""
|
||||||
jobs:
|
needs: build
|
||||||
lint:
|
|
||||||
runs-on: docker
|
|
||||||
container:
|
|
||||||
image: rust:latest
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Install Node.js
|
- name: Verify Docker connection
|
||||||
run: |
|
run: |
|
||||||
apt-get update && apt-get install -y curl
|
echo "DOCKER_HOST: $DOCKER_HOST"
|
||||||
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
|
docker --version
|
||||||
apt-get install -y nodejs
|
docker info
|
||||||
|
docker ps
|
||||||
|
|
||||||
- uses: https://github.com/actions/checkout@v4
|
- uses: https://github.com/actions/checkout@v4
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Build Docker image
|
||||||
|
working-directory: ./backend
|
||||||
run: |
|
run: |
|
||||||
apt-get update && apt-get install -y pkg-config libssl-dev
|
docker build -t normogen-backend:test .
|
||||||
|
docker images | grep normogen-backend
|
||||||
- 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
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue