Skip to content

Commit

Permalink
GitHub CI: Switch from x86-64 to Apple silicon on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
uklotzde committed Jul 29, 2023
1 parent 3baf04a commit 08b23f5
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 31 deletions.
61 changes: 38 additions & 23 deletions .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,42 @@ env:

jobs:
build-and-test:
runs-on: ${{ matrix.runner_os }}
strategy:
matrix:
include:
- target: aarch64-apple-darwin
runner_os: macos-latest
# Runner (x86-64) and target are not compatible.
run_tests: false
- target: x86_64-pc-windows-msvc
runner_os: windows-latest
run_tests: true
- target: x86_64-unknown-linux-musl
runner_os: ubuntu-latest
run_tests: true

runs-on: ${{ matrix.runner_os }}

steps:
- name: Install dependencies for musl libc
if: matrix.target == 'x86_64-unknown-linux-musl'
run: |
sudo apt -y install musl-tools
sudo apt update && \
sudo apt -y install \
musl-tools
# See also: <https://github.com/emilk/egui/blob/master/.github/workflows/rust.yml>
- name: Install dependencies for `egui` on Linux
if: runner.os == 'Linux'
run: |
sudo apt-get install libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libspeechd-dev libxkbcommon-dev libssl-dev
sudo apt update && \
sudo apt -y install \
libgtk-3-dev \
libssl-dev \
libxcb-render0-dev \
libxcb-shape0-dev \
libxcb-xfixes0-dev \
libxkbcommon-dev
# See also: <https://github.com/rusqlite/rusqlite/blob/master/.github/workflows/main.yml>
- name: Add LLVM path on Windows
Expand All @@ -67,80 +81,81 @@ jobs:

- name: Check aoide-core
run: |
cargo check --locked --all-targets --all-features --manifest-path crates/core/Cargo.toml
cargo check --locked --target ${{ matrix.target }} --all-targets --all-features --manifest-path crates/core/Cargo.toml
- name: Check aoide-core-json
run: |
cargo check --locked --all-targets --all-features --manifest-path crates/core-json/Cargo.toml
cargo check --locked --target ${{ matrix.target }} --all-targets --all-features --manifest-path crates/core-json/Cargo.toml
- name: Check aoide-core-api
run: |
cargo check --locked --all-targets --all-features --manifest-path crates/core-api/Cargo.toml
cargo check --locked --target ${{ matrix.target }} --all-targets --all-features --manifest-path crates/core-api/Cargo.toml
- name: Check aoide-core-api-json
run: |
cargo check --locked --all-targets --all-features --manifest-path crates/core-api-json/Cargo.toml
cargo check --locked --target ${{ matrix.target }} --all-targets --all-features --manifest-path crates/core-api-json/Cargo.toml
- name: Check aoide-desktop-app
run: |
cargo check --locked --all-targets --all-features --manifest-path crates/desktop-app/Cargo.toml
cargo check --locked --target ${{ matrix.target }} --all-targets --all-features --manifest-path crates/desktop-app/Cargo.toml
- name: Check aoide-media
run: |
cargo check --locked --all-targets --all-features --manifest-path crates/media-file/Cargo.toml
cargo check --locked --target ${{ matrix.target }} --all-targets --all-features --manifest-path crates/media-file/Cargo.toml
- name: Check aoide-repo
run: |
cargo check --locked --all-targets --all-features --manifest-path crates/repo/Cargo.toml
cargo check --locked --target ${{ matrix.target }} --all-targets --all-features --manifest-path crates/repo/Cargo.toml
- name: Check aoide-repo-sqlite
run: |
cargo check --locked --all-targets --all-features --manifest-path crates/repo-sqlite/Cargo.toml
cargo check --locked --target ${{ matrix.target }} --all-targets --all-features --manifest-path crates/repo-sqlite/Cargo.toml
- name: Check aoide-storage-sqlite
run: |
cargo check --locked --all-targets --all-features --manifest-path crates/storage-sqlite/Cargo.toml
cargo check --locked --target ${{ matrix.target }} --all-targets --all-features --manifest-path crates/storage-sqlite/Cargo.toml
- name: Check aoide-search-index-tantivy
run: |
cargo check --locked --all-targets --all-features --manifest-path crates/search-index-tantivy/Cargo.toml
cargo check --locked --target ${{ matrix.target }} --all-targets --all-features --manifest-path crates/search-index-tantivy/Cargo.toml
- name: Check aoide-usecases
run: |
cargo check --locked --all-targets --all-features --manifest-path crates/usecases/Cargo.toml
cargo check --locked --target ${{ matrix.target }} --all-targets --all-features --manifest-path crates/usecases/Cargo.toml
- name: Check aoide-usecases-sqlite
run: |
cargo check --locked --all-targets --all-features --manifest-path crates/usecases-sqlite/Cargo.toml
cargo check --locked --target ${{ matrix.target }} --all-targets --all-features --manifest-path crates/usecases-sqlite/Cargo.toml
- name: Check aoide-backend-embedded
run: |
cargo check --locked --all-targets --all-features --manifest-path crates/backend-embedded/Cargo.toml
cargo check --locked --target ${{ matrix.target }} --all-targets --all-features --manifest-path crates/backend-embedded/Cargo.toml
- name: Check aoide-backend-webapi-json
run: |
cargo check --locked --all-targets --all-features --manifest-path crates/backend-webapi-json/Cargo.toml
cargo check --locked --target ${{ matrix.target }} --target ${{ matrix.target }} --all-targets --all-features --manifest-path crates/backend-webapi-json/Cargo.toml
- name: Check aoide-websrv-warp-sqlite
run: |
cargo check --locked --all-targets --all-features --manifest-path crates/websrv-warp-sqlite/Cargo.toml
cargo check --locked --target ${{ matrix.target }} --all-targets --all-features --manifest-path crates/websrv-warp-sqlite/Cargo.toml
- name: Check aoide-websrv
run: |
cargo check --locked --all-targets --all-features --manifest-path websrv/Cargo.toml
cargo check --locked --target ${{ matrix.target }} --all-targets --all-features --manifest-path websrv/Cargo.toml
- name: Check aoide-client
run: |
cargo check --locked --all-targets --all-features --manifest-path crates/client/Cargo.toml
cargo check --locked --target ${{ matrix.target }} --all-targets --all-features --manifest-path crates/client/Cargo.toml
- name: Check aoide-webcli
run: |
cargo check --locked --all-targets --all-features --manifest-path webcli/Cargo.toml
cargo check --locked --target ${{ matrix.target }} --all-targets --all-features --manifest-path webcli/Cargo.toml
- name: Build tests with all features enabled
run: |
cargo test --locked --workspace --all-targets --all-features --no-run
cargo test --locked --target ${{ matrix.target }} --workspace --all-targets --all-features --no-run
- name: Run tests with all features enabled
if: matrix.run_tests
run: |
cargo test --locked --workspace --all-targets --all-features -- --nocapture --quiet
cargo test --locked --target ${{ matrix.target }} --workspace --all-targets --all-features -- --nocapture --quiet
26 changes: 18 additions & 8 deletions .github/workflows/pre-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,39 +16,49 @@ env:

jobs:
build-and-upload-artifacts:
runs-on: ${{ matrix.runner_os }}
strategy:
matrix:
build_package:
- aoide-websrv
build_profile:
- production
target:
- aarch64-apple-darwin
- x86_64-unknown-linux-musl
- x86_64-apple-darwin
- x86_64-pc-windows-msvc
include:
- target: aarch64-apple-darwin
runner_os: macos-latest
artifact_suffix: .tar.xz
- target: x86_64-unknown-linux-musl
runner_os: ubuntu-latest
artifact_suffix: .tar.xz
- target: x86_64-apple-darwin
runner_os: macos-latest
artifact_suffix: .tar.xz
- target: x86_64-pc-windows-msvc
runner_os: windows-latest
artifact_suffix: .7z

runs-on: ${{ matrix.runner_os }}

steps:
- name: Install dependencies for `musl libc` on Linux
if: matrix.target == 'x86_64-unknown-linux-musl'
run: |
sudo apt -y install musl-tools
sudo apt update && \
sudo apt -y install \
musl-tools
# See also: <https://github.com/emilk/egui/blob/master/.github/workflows/rust.yml>
- name: Install dependencies for `egui` on Linux
if: runner.os == 'Linux'
run: |
sudo apt-get install libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libspeechd-dev libxkbcommon-dev libssl-dev
sudo apt update && \
sudo apt -y install \
libgtk-3-dev \
libssl-dev \
libxcb-render0-dev \
libxcb-shape0-dev \
libxcb-xfixes0-dev \
libxkbcommon-dev
# See also: <https://github.com/rusqlite/rusqlite/blob/master/.github/workflows/main.yml>
- name: Add LLVM path on Windows
Expand All @@ -74,7 +84,7 @@ jobs:
cargo build --locked --target ${{ matrix.target }} --profile ${{ matrix.build_profile }} --package ${{ matrix.build_package }}
- name: Prepare artifact on Linux/macOS
if: runner.os == 'Linux' || runner.os == 'macOS'
if: runner.os != 'Windows'
run: |
cd target/${{ matrix.target }}/${{ matrix.build_profile }}
tar cJvf ../../../${{ matrix.build_package }}-${{ matrix.target }}${{ matrix.artifact_suffix }} ${{ matrix.build_package }}
Expand Down

0 comments on commit 08b23f5

Please sign in to comment.