github: split matrix into individual build steps per OS
So we don't have to wait for the whole matrix to start building individual packages per OS Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
56
.github/workflows/build-and-test.yml
vendored
Normal file
56
.github/workflows/build-and-test.yml
vendored
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
name: Build & Test
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
os:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
upload-artifact-name:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
upload-artifact-path:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
additional-setup:
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
run:
|
||||||
|
runs-on: ${{ inputs.os }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout Code
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Setup Rust
|
||||||
|
uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
profile: minimal
|
||||||
|
toolchain: stable
|
||||||
|
override: true
|
||||||
|
|
||||||
|
- name: Rust cache
|
||||||
|
uses: Swatinem/rust-cache@v2
|
||||||
|
|
||||||
|
- name: Additional Setup (if specified)
|
||||||
|
if: ${{ inputs.additional-setup != '' }}
|
||||||
|
run: ${{ inputs.additional-setup }}
|
||||||
|
|
||||||
|
- name: Run Tests
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: test
|
||||||
|
args: --release
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: build
|
||||||
|
args: --release
|
||||||
|
|
||||||
|
- name: Upload Build Artifacts
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: ${{ inputs.upload-artifact-name }}
|
||||||
|
path: ${{ inputs.upload-artifact-path }}
|
||||||
105
.github/workflows/rust.yml
vendored
105
.github/workflows/rust.yml
vendored
@@ -37,85 +37,36 @@ jobs:
|
|||||||
command: clippy
|
command: clippy
|
||||||
args: -- -D warnings
|
args: -- -D warnings
|
||||||
|
|
||||||
build-and-test:
|
linux-build-test:
|
||||||
name: Build and Test (${{ matrix.os }})
|
name: Build and Test (Linux)
|
||||||
runs-on: ${{ matrix.os }}
|
uses: ./.github/workflows/build-and-test.yml
|
||||||
strategy:
|
with:
|
||||||
matrix:
|
os: ubuntu-latest
|
||||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
upload-artifact-name: notedeck-linux-bin
|
||||||
toolchain: [stable]
|
upload-artifact-path: target/release/notedeck
|
||||||
steps:
|
additional-setup: |
|
||||||
# Checkout the repository
|
sudo apt-get install libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libspeechd-dev libxkbcommon-dev libssl-dev
|
||||||
- name: Checkout Code
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
|
|
||||||
# Set up the Rust toolchain
|
macos-build-test:
|
||||||
- name: Setup Rust
|
name: Build and Test (macOS)
|
||||||
uses: actions-rs/toolchain@v1
|
uses: ./.github/workflows/build-and-test.yml
|
||||||
with:
|
with:
|
||||||
profile: minimal
|
os: macos-latest
|
||||||
toolchain: ${{ matrix.toolchain }}
|
upload-artifact-name: notedeck-macos-bin
|
||||||
override: true
|
upload-artifact-path: target/release/notedeck
|
||||||
|
|
||||||
# Cache
|
windows-build-test:
|
||||||
- name: Rust cache
|
name: Build and Test (Windows)
|
||||||
uses: Swatinem/rust-cache@v2
|
uses: ./.github/workflows/build-and-test.yml
|
||||||
|
with:
|
||||||
# Install dependencies (only for Ubuntu)
|
os: windows-latest
|
||||||
- name: Install Dependencies (Ubuntu)
|
upload-artifact-name: notedeck.exe
|
||||||
if: runner.os == 'Linux'
|
upload-artifact-path: target/release/notedeck.exe
|
||||||
run: sudo apt-get install libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libspeechd-dev libxkbcommon-dev libssl-dev
|
|
||||||
|
|
||||||
# Run tests
|
|
||||||
- name: Run Tests
|
|
||||||
uses: actions-rs/cargo@v1
|
|
||||||
with:
|
|
||||||
command: test
|
|
||||||
args: --release
|
|
||||||
|
|
||||||
# Build
|
|
||||||
- name: Build
|
|
||||||
uses: actions-rs/cargo@v1
|
|
||||||
with:
|
|
||||||
command: build
|
|
||||||
args: --release
|
|
||||||
|
|
||||||
# Strip Debug Symbols
|
|
||||||
#
|
|
||||||
## > Don't strip for now <
|
|
||||||
#
|
|
||||||
#- name: Strip Debug Symbols
|
|
||||||
# if: runner.os == 'Linux'
|
|
||||||
# run: strip target/release/notedeck || echo "Skipping strip if not applicable"
|
|
||||||
|
|
||||||
# Upload bin for further packaging steps
|
|
||||||
- name: Upload Build Artifacts (Linux)
|
|
||||||
if: runner.os == 'Linux'
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: notedeck-linux-bin
|
|
||||||
path: target/release/notedeck
|
|
||||||
|
|
||||||
# Upload artifacts (for macOS, adjust paths as needed)
|
|
||||||
- name: Upload Build Artifacts (macOS)
|
|
||||||
if: runner.os == 'macOS'
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: notedeck-macos-bin
|
|
||||||
path: target/release/notedeck
|
|
||||||
|
|
||||||
# Upload exe for further packaging steps
|
|
||||||
- name: Upload Build Artifacts (Windows)
|
|
||||||
if: runner.os == 'Windows'
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: notedeck.exe
|
|
||||||
path: target/release/notedeck.exe
|
|
||||||
|
|
||||||
packaging:
|
packaging:
|
||||||
name: Build Linux Packages
|
name: Build Linux Packages
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: build-and-test
|
needs: linux-build-test
|
||||||
steps:
|
steps:
|
||||||
# Checkout the repository
|
# Checkout the repository
|
||||||
- name: Checkout Code
|
- name: Checkout Code
|
||||||
@@ -161,7 +112,7 @@ jobs:
|
|||||||
macos-dmg:
|
macos-dmg:
|
||||||
name: Build macOS DMG
|
name: Build macOS DMG
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
needs: build-and-test
|
needs: macos-build-test
|
||||||
env:
|
env:
|
||||||
NOTEDECK_APPLE_RELEASE_CERT_ID: ${{ secrets.NOTEDECK_APPLE_RELEASE_CERT_ID }}
|
NOTEDECK_APPLE_RELEASE_CERT_ID: ${{ secrets.NOTEDECK_APPLE_RELEASE_CERT_ID }}
|
||||||
NOTEDECK_RELEASE_APPLE_ID: ${{ secrets.NOTEDECK_RELEASE_APPLE_ID }}
|
NOTEDECK_RELEASE_APPLE_ID: ${{ secrets.NOTEDECK_RELEASE_APPLE_ID }}
|
||||||
@@ -180,6 +131,10 @@ jobs:
|
|||||||
toolchain: stable
|
toolchain: stable
|
||||||
override: true
|
override: true
|
||||||
|
|
||||||
|
# create-dmg and cargo-bundle caching
|
||||||
|
- name: Rust cache
|
||||||
|
uses: Swatinem/rust-cache@v2
|
||||||
|
|
||||||
- name: Download Build Artifacts (MacOS)
|
- name: Download Build Artifacts (MacOS)
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
@@ -209,7 +164,7 @@ jobs:
|
|||||||
windows-installer:
|
windows-installer:
|
||||||
name: Build Windows Installer
|
name: Build Windows Installer
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
needs: build-and-test
|
needs: windows-build-test
|
||||||
steps:
|
steps:
|
||||||
# Checkout the repository
|
# Checkout the repository
|
||||||
- name: Checkout Code
|
- name: Checkout Code
|
||||||
|
|||||||
Reference in New Issue
Block a user