refactor(ci): replace dynamic matrix with static includes
All checks were successful
poll-upstream / check (push) Successful in 1s
All checks were successful
poll-upstream / check (push) Successful in 1s
Gitea Actions doesn't support fromJSON in matrix strategies (expressions are evaluated before dependent jobs run). Move flavour definitions into the workflow as static matrix includes and remove flavours.yml. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -9,30 +9,17 @@ on:
|
|||||||
type: string
|
type: string
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
plan:
|
|
||||||
runs-on: fedora
|
|
||||||
outputs:
|
|
||||||
flavours: ${{ steps.plan.outputs.flavours }}
|
|
||||||
version: ${{ steps.plan.outputs.version }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- id: plan
|
|
||||||
run: |
|
|
||||||
version="${TAG#v}"
|
|
||||||
echo "version=${version}" >> "$GITHUB_OUTPUT"
|
|
||||||
# Emit flavours as a JSON array for matrix consumption
|
|
||||||
flavours=$(yq --compact-output '.flavours' flavours.yml)
|
|
||||||
echo "flavours=${flavours}" >> "$GITHUB_OUTPUT"
|
|
||||||
env:
|
|
||||||
TAG: ${{ inputs.tag }}
|
|
||||||
|
|
||||||
build:
|
build:
|
||||||
needs: plan
|
|
||||||
runs-on: cuda-13.0
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
flavour: ${{ fromJSON(needs.plan.outputs.flavours) }}
|
include:
|
||||||
|
- name: cuda13
|
||||||
|
runner: cuda-13.0
|
||||||
|
cuda_home: /usr/local/cuda-13.0
|
||||||
|
cargo_features: "cuda cudnn flash-attn nccl"
|
||||||
|
compute_caps: "120"
|
||||||
|
runs-on: ${{ matrix.runner }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
@@ -44,57 +31,58 @@ jobs:
|
|||||||
- name: Build
|
- name: Build
|
||||||
run: ./script/build-binary.sh
|
run: ./script/build-binary.sh
|
||||||
env:
|
env:
|
||||||
FLAVOUR_NAME: ${{ matrix.flavour.name }}
|
FLAVOUR_NAME: ${{ matrix.name }}
|
||||||
CUDA_HOME: ${{ matrix.flavour.cuda_home }}
|
CUDA_HOME: ${{ matrix.cuda_home }}
|
||||||
CARGO_FEATURES: ${{ matrix.flavour.cargo_features }}
|
CARGO_FEATURES: ${{ matrix.cargo_features }}
|
||||||
CUDA_COMPUTE_CAP: ${{ matrix.flavour.compute_caps }}
|
CUDA_COMPUTE_CAP: ${{ matrix.compute_caps }}
|
||||||
SRC_DIR: src
|
SRC_DIR: src
|
||||||
|
|
||||||
- name: Upload binary artifact
|
- name: Upload binary artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: mistralrs-server-${{ matrix.flavour.name }}
|
name: mistralrs-server-${{ matrix.name }}
|
||||||
path: artifacts/mistralrs-server-${{ matrix.flavour.name }}
|
path: artifacts/mistralrs-server-${{ matrix.name }}
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
package:
|
package:
|
||||||
needs: [plan, build]
|
needs: build
|
||||||
runs-on: fedora
|
runs-on: fedora
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
flavour: ${{ fromJSON(needs.plan.outputs.flavours) }}
|
include:
|
||||||
|
- name: cuda13
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
#- name: Install build tools
|
|
||||||
# run: sudo dnf install -y rpm-build rpmdevtools systemd-rpm-macros
|
|
||||||
|
|
||||||
- name: Download binary
|
- name: Download binary
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: mistralrs-server-${{ matrix.flavour.name }}
|
name: mistralrs-server-${{ matrix.name }}
|
||||||
path: artifacts/
|
path: artifacts/
|
||||||
|
|
||||||
- name: Build RPM
|
- name: Build RPM
|
||||||
run: |
|
run: |
|
||||||
|
version="${TAG#v}"
|
||||||
rpmdev-setuptree
|
rpmdev-setuptree
|
||||||
cp artifacts/mistralrs-server-${{ matrix.flavour.name }} ~/rpmbuild/SOURCES/
|
cp artifacts/mistralrs-server-${{ matrix.name }} ~/rpmbuild/SOURCES/
|
||||||
cp rpm/systemd/mistralrs@.service ~/rpmbuild/SOURCES/
|
cp rpm/systemd/mistralrs@.service ~/rpmbuild/SOURCES/
|
||||||
cp rpm/systemd/mistralrs@.conf.example ~/rpmbuild/SOURCES/
|
cp rpm/systemd/mistralrs@.conf.example ~/rpmbuild/SOURCES/
|
||||||
rpmbuild -bb rpm/mistralrs.spec \
|
rpmbuild -bb rpm/mistralrs.spec \
|
||||||
--define "mistralrs_version ${{ needs.plan.outputs.version }}" \
|
--define "mistralrs_version ${version}" \
|
||||||
--define "mistralrs_flavour ${{ matrix.flavour.name }}"
|
--define "mistralrs_flavour ${{ matrix.name }}"
|
||||||
|
env:
|
||||||
|
TAG: ${{ inputs.tag }}
|
||||||
|
|
||||||
- name: Upload RPM
|
- name: Upload RPM
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: rpm-${{ matrix.flavour.name }}
|
name: rpm-${{ matrix.name }}
|
||||||
path: ~/rpmbuild/RPMS/x86_64/*.rpm
|
path: ~/rpmbuild/RPMS/x86_64/*.rpm
|
||||||
retention-days: 7
|
retention-days: 7
|
||||||
|
|
||||||
publish:
|
publish:
|
||||||
needs: [plan, package]
|
needs: package
|
||||||
runs-on: fedora
|
runs-on: fedora
|
||||||
# concurrency ensures only one publish runs at a time — repo metadata
|
# concurrency ensures only one publish runs at a time — repo metadata
|
||||||
# corruption is a nightmare if two createrepo_c processes race.
|
# corruption is a nightmare if two createrepo_c processes race.
|
||||||
@@ -104,9 +92,6 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
#- name: Install tools
|
|
||||||
# run: sudo dnf install -y createrepo_c rpm-sign rsync
|
|
||||||
|
|
||||||
- name: Download all RPMs
|
- name: Download all RPMs
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
flavours:
|
|
||||||
- name: cuda13
|
|
||||||
cuda_home: /usr/local/cuda-13.0
|
|
||||||
cargo_features: "cuda cudnn flash-attn nccl"
|
|
||||||
compute_caps: "120"
|
|
||||||
Reference in New Issue
Block a user