split build and test jobs
This commit is contained in:
@ -5,26 +5,43 @@ on: [push]
|
|||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: rust-latest
|
runs-on: rust-latest
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
working-directory: ./backend
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Load Cache
|
- name: Load Cache
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
working-directory: ./backend
|
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
~/.cargo/registry
|
~/.cargo/registry
|
||||||
~/.cargo/git
|
~/.cargo/git
|
||||||
target
|
target
|
||||||
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
|
key: ${{ runner.os }}-cargo-build-${{ hashFiles('Cargo.lock') }}
|
||||||
- name: Build Binary
|
- name: Build Release Binary
|
||||||
working-directory: ./backend
|
|
||||||
run: cargo build --release --locked
|
run: cargo build --release --locked
|
||||||
- name: Run Tests
|
|
||||||
|
test:
|
||||||
|
runs-on: rust-latest
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
working-directory: ./backend
|
working-directory: ./backend
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Load Cache
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cargo/registry
|
||||||
|
~/.cargo/git
|
||||||
|
target
|
||||||
|
key: ${{ runner.os }}-cargo-test-${{ hashFiles('Cargo.lock') }}
|
||||||
|
- name: Build Test Binary
|
||||||
|
run: cargo test --no-run
|
||||||
|
- name: Run Tests
|
||||||
run: ./scripts/test.sh
|
run: ./scripts/test.sh
|
||||||
- name: Upload Test Logs
|
- name: Upload Test Logs
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
working-directory: ./backend
|
|
||||||
with:
|
with:
|
||||||
name: nuchat-${{ hashFiles('src/**') }}-${{ hashFiles('tests/**') }}.log
|
name: nuchat-${{ hashFiles('src/**') }}-${{ hashFiles('tests/**') }}.log
|
||||||
path: logs/*
|
path: logs/*
|
||||||
|
|||||||
Reference in New Issue
Block a user