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