Skip to content

fix: build cache

fix: build cache #3

Workflow file for this run

name: Build
on:
push:
paths:
- '.github/workflows/build.yml'
- 'Cargo.toml'
- 'src/**/*'
- 'web/**/*'
pull_request:
paths:
- '.github/workflows/build.yml'
- 'Cargo.toml'
- 'src/**/*'
- 'web/**/*'
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
build:
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
platform: [windows-latest, ubuntu-20.04, macos-latest]
steps:
- uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: pnpm/action-setup@v2
with:
version: 8.6.7
- uses: actions/setup-node@v4
with:
node-version: '20.x'
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
backend/target/
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
- uses: actions/checkout@v4
- name: Install dependencies
run: cd web && pnpm install
- name: Build
if: matrix.platform == 'windows-latest'
run: cd ./web && pnpm run build && cd ../ && cargo build --release
- name: Upload
uses: actions/upload-artifact@v4
if: matrix.platform != 'windows-latest'
with:
name: omcp-${{ matrix.platform }}
path: backend/target/release/open_mc_panel
- name: Upload (Windows)
uses: actions/upload-artifact@v4
if: matrix.platform == 'windows-latest'
with:
name: omcp-${{ matrix.platform }}
path: backend/target/release/open_mc_panel.exe