Revert "feat: Add support for multiple CPU targets in Rust workflow (#1707)"
This reverts commit 83199db6a1.
This commit is contained in:
parent
308cc943c1
commit
f8596dcaf8
206
.github/workflows/rust.yml
vendored
206
.github/workflows/rust.yml
vendored
@ -2,9 +2,7 @@ name: Cargo Build, Test, and Linting
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master ]
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
@ -17,171 +15,123 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
toolchain: [stable]
|
toolchain:
|
||||||
|
- stable
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
|
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
|
||||||
- run: rustup component add rustfmt
|
- run: rustup component add rustfmt
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
- run: cargo fmt --check
|
- run: cargo fmt --check
|
||||||
|
|
||||||
machete:
|
machete:
|
||||||
name: Detect unused dependencies
|
name: Detect unused dependencies
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [format]
|
needs: [format]
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
toolchain: [stable]
|
toolchain:
|
||||||
|
- stable
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
|
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
|
||||||
- uses: bnjbvr/cargo-machete@main
|
- uses: bnjbvr/cargo-machete@main
|
||||||
|
|
||||||
clippy_debug:
|
clippy_debug:
|
||||||
name: Run lints (debug)
|
name: Run lints (debug)
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [machete]
|
needs: [machete]
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
toolchain: [stable]
|
toolchain:
|
||||||
|
- stable
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
|
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
|
||||||
- run: rustup component add clippy
|
- run: rustup component add clippy
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
- run: cargo clippy --all-targets --all-features
|
- name: Clippy (debug)
|
||||||
|
run: cargo clippy --all-targets --all-features
|
||||||
clippy_release:
|
clippy_release:
|
||||||
name: Run lints (release)
|
name: Run lints (release)
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [machete]
|
needs: [machete]
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
toolchain: [stable]
|
toolchain:
|
||||||
|
- stable
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
|
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
|
||||||
- run: rustup component add clippy
|
- run: rustup component add clippy
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
- run: cargo clippy --release --all-targets --all-features
|
- name: Clippy (release)
|
||||||
|
run: cargo clippy --release --all-targets --all-features
|
||||||
build_and_test:
|
build_and_test:
|
||||||
name: Build and test (${{ matrix.os }}, ${{ matrix.arch_variant }})
|
name: Build project and test
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
needs: [clippy_debug, clippy_release]
|
needs: [clippy_debug, clippy_release]
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, windows-11-arm, macos-latest, macos-15-intel]
|
os:
|
||||||
arch_variant: [standard, x86-64-v3]
|
[
|
||||||
toolchain: [stable]
|
ubuntu-latest,
|
||||||
exclude:
|
ubuntu-24.04-arm,
|
||||||
- os: ubuntu-24.04-arm
|
windows-latest,
|
||||||
arch_variant: x86-64-v3
|
windows-11-arm,
|
||||||
- os: windows-11-arm
|
macos-latest,
|
||||||
arch_variant: x86-64-v3
|
macos-15-intel,
|
||||||
- os: macos-latest
|
]
|
||||||
arch_variant: x86-64-v3
|
toolchain:
|
||||||
- os: macos-15-intel
|
- stable
|
||||||
arch_variant: standard
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
|
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
|
||||||
- uses: taiki-e/install-action@nextest
|
- uses: taiki-e/install-action@nextest
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
- name: Set CPU flags
|
- name: Cargo nextest
|
||||||
if: matrix.arch_variant != 'standard'
|
run: cargo nextest run --verbose
|
||||||
shell: bash
|
- name: Cargo doctest
|
||||||
run: |
|
run: cargo test --doc --verbose
|
||||||
echo "RUSTFLAGS=-C target-cpu=${{ matrix.arch_variant }}" >> "$GITHUB_ENV"
|
|
||||||
- run: cargo nextest run --verbose
|
|
||||||
- run: cargo test --doc --verbose
|
|
||||||
|
|
||||||
build_release:
|
build_release:
|
||||||
name: Build Release (${{ matrix.platform }}-${{ matrix.arch }}-${{ matrix.variant }})
|
name: Build project in release
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
needs: [build_and_test]
|
needs: [build_and_test]
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
os:
|
||||||
- os: ubuntu-latest
|
[
|
||||||
platform: linux
|
ubuntu-latest,
|
||||||
arch: x86_64
|
ubuntu-24.04-arm,
|
||||||
variant: standard
|
windows-latest,
|
||||||
bin: pumpkin
|
windows-11-arm,
|
||||||
- os: ubuntu-latest
|
macos-latest,
|
||||||
platform: linux
|
macos-15-intel,
|
||||||
arch: x86_64
|
]
|
||||||
variant: x86-64-v3
|
toolchain:
|
||||||
bin: pumpkin
|
- stable
|
||||||
- os: ubuntu-24.04-arm
|
|
||||||
platform: linux
|
|
||||||
arch: aarch64
|
|
||||||
variant: standard
|
|
||||||
bin: pumpkin
|
|
||||||
- os: windows-latest
|
|
||||||
platform: windows
|
|
||||||
arch: x86_64
|
|
||||||
variant: standard
|
|
||||||
bin: pumpkin.exe
|
|
||||||
- os: windows-latest
|
|
||||||
platform: windows
|
|
||||||
arch: x86_64
|
|
||||||
variant: x86-64-v3
|
|
||||||
bin: pumpkin.exe
|
|
||||||
- os: windows-11-arm
|
|
||||||
platform: windows
|
|
||||||
arch: aarch64
|
|
||||||
variant: standard
|
|
||||||
bin: pumpkin.exe
|
|
||||||
- os: macos-latest
|
|
||||||
platform: macos
|
|
||||||
arch: aarch64
|
|
||||||
variant: standard
|
|
||||||
bin: pumpkin
|
|
||||||
- os: macos-15-intel
|
|
||||||
platform: macos
|
|
||||||
arch: x86_64
|
|
||||||
variant: x86-64-v3
|
|
||||||
bin: pumpkin
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
- name: Install Rust and set flags
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
rustup update stable && rustup default stable
|
|
||||||
if [ "${{ matrix.variant }}" != "standard" ]; then
|
|
||||||
echo "RUSTFLAGS=-C target-cpu=${{ matrix.variant }}" >> "$GITHUB_ENV"
|
|
||||||
fi
|
|
||||||
- uses: Swatinem/rust-cache@v2
|
|
||||||
- run: cargo build --release --verbose
|
|
||||||
- name: Verify binary
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
if [ ! -f "target/release/${{ matrix.bin }}" ]; then
|
|
||||||
echo "Binary not found"; ls -la target/release/; exit 1
|
|
||||||
fi
|
|
||||||
- name: Prepare artifact with clean name
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
name="pumpkin-${{ matrix.platform }}-${{ matrix.arch }}"
|
|
||||||
if [ "${{ matrix.variant }}" != "standard" ]; then
|
|
||||||
suffix="${{ matrix.variant }}"
|
|
||||||
suffix="${suffix#x86-64-}"
|
|
||||||
name="$name-$suffix"
|
|
||||||
fi
|
|
||||||
if [ "${{ matrix.platform }}" = "windows" ]; then
|
|
||||||
name="$name.exe"
|
|
||||||
fi
|
|
||||||
mkdir -p dist
|
|
||||||
cp "target/release/${{ matrix.bin }}" "dist/$name"
|
|
||||||
- uses: actions/upload-artifact@v7
|
|
||||||
with:
|
|
||||||
name: release-${{ matrix.platform }}-${{ matrix.arch }}-${{ matrix.variant }}
|
|
||||||
path: dist/*
|
|
||||||
if-no-files-found: error
|
|
||||||
compression-level: 9
|
|
||||||
|
|
||||||
|
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
|
||||||
|
- uses: Swatinem/rust-cache@v2
|
||||||
|
- name: Build Release
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
if [[ "${{ runner.arch }}" == "X64" ]]; then
|
||||||
|
export RUSTFLAGS="$RUSTFLAGS -C target-cpu=x86-64-v3"
|
||||||
|
fi
|
||||||
|
cargo build --verbose --release
|
||||||
|
- name: Prepare artifacts
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
mkdir -p dist
|
||||||
|
if [ "${{ runner.os }}" == "Windows" ]; then EXT=".exe"; fi
|
||||||
|
cp "target/release/pumpkin$EXT" "dist/pumpkin-${{ runner.arch }}-${{ runner.os }}$EXT"
|
||||||
|
- name: Export executable
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
name: pumpkin-${{ runner.arch }}-${{ runner.os }}
|
||||||
|
compression-level: 9
|
||||||
|
path: dist/pumpkin-*
|
||||||
draft_release:
|
draft_release:
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
@ -190,28 +140,30 @@ jobs:
|
|||||||
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
- uses: actions/download-artifact@v8
|
- name: Download prebuilt binary artifacts
|
||||||
|
uses: actions/download-artifact@v8
|
||||||
with:
|
with:
|
||||||
|
pattern: "**/pumpkin-*"
|
||||||
path: dist/
|
path: dist/
|
||||||
pattern: release-*
|
|
||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
- run: find dist/ -type f | sort
|
- name: Generate release notes
|
||||||
- run: |
|
run: |
|
||||||
echo "# Nightly Build" > dist/RELEASE.md
|
tree dist/
|
||||||
echo "Commit: $(git rev-parse --short HEAD)" >> dist/RELEASE.md
|
echo "From commit: $(git rev-parse --short HEAD)" > dist/RELEASE.md
|
||||||
echo "Date: $(date -u +'%Y-%m-%d %H:%M UTC')" >> dist/RELEASE.md
|
echo "Generated on: $(date -u +"%Y-%m-%d %H:%M") UTC" >> dist/RELEASE.md
|
||||||
- run: |
|
cat dist/RELEASE.md
|
||||||
|
|
||||||
|
- name: Update the nightly tag
|
||||||
|
run: |
|
||||||
git config user.name "github-actions[bot]"
|
git config user.name "github-actions[bot]"
|
||||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
git tag -f nightly
|
git tag --force nightly && git push --force origin tag nightly
|
||||||
git push origin :nightly 2>/dev/null || true
|
|
||||||
git push origin refs/tags/nightly
|
- name: Draft a nightly github release
|
||||||
- uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
|
prerelease: true
|
||||||
|
files: dist/pumpkin*
|
||||||
tag_name: nightly
|
tag_name: nightly
|
||||||
name: Nightly Build
|
name: Nightly Build
|
||||||
prerelease: true
|
|
||||||
body_path: dist/RELEASE.md
|
body_path: dist/RELEASE.md
|
||||||
files: |
|
|
||||||
dist/pumpkin-*
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user