Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: update PR ci to only run one "task" with all jobs and not two "ta… #25

Merged
merged 1 commit into from
Feb 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 0 additions & 34 deletions .github/workflows/branch.yml

This file was deleted.

66 changes: 62 additions & 4 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ on:

env:
TEST_TAG: my-test:test
CARGO_TERM_COLOR: always

jobs:
frontend_lint:
frontend-lint:
runs-on: ubuntu-latest
defaults:
run:
Expand All @@ -18,7 +19,7 @@ jobs:
run: bun install --frozen-lockfile
- name: Check formatting
run: bun run format:check
frontend_build:
frontend-build:
runs-on: ubuntu-latest
defaults:
run:
Expand All @@ -30,12 +31,15 @@ jobs:
run: bun install --frozen-lockfile
- name: Build
run: bun run build
frontend_check-docker:
frontend-check-docker:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./frontend
needs: frontend_build
needs:
- frontend-build
- frontend-lint
if: ${{ needs.frontend-build.result == 'success' && needs.frontend-lint.result == 'success' }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -49,3 +53,57 @@ jobs:
context: ./frontend
load: true
tags: ${{ env.TEST_TAG }}
backend-lint:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./rust/api-server
steps:
- uses: actions/checkout@v4
- name: Rust setup
run: rustup toolchain install stable --profile minimal
- name: Lint
run: cargo fmt --check
backend-build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./rust/api-server
steps:
- uses: actions/checkout@v4
- name: Rust setup
run: rustup toolchain install stable --profile minimal
- name: Cache Cargo build target
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
rust/api-server/target
key: ${{ runner.os }}-cargo-target-${{ hashFiles('**/Cargo.lock') }}
- name: Build
run: cargo build --release --bin bitcraft-hub-api
backend-check-docker:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./rust/api-server
needs:
- backend-build
- backend-lint
if: ${{ needs.backend-build.result == 'success' && needs.backend-lint.result == 'success' }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and export to Docker
uses: docker/build-push-action@v5
with:
context: ./rust/api-server
load: true
tags: ${{ env.TEST_TAG }}
Loading