Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 22 additions & 44 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,55 +4,32 @@ on: pull_request

jobs:
ci:
name: ${{ matrix.task.name }} (${{ matrix.os.name }})
runs-on: ${{ matrix.os.name }}
name: ${{ matrix.task.name }} (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- name: ubuntu-22.04
family: ubuntu
- name: ubuntu-24.04
family: ubuntu
- name: macos-13-large
family: darwin
- name: macos-14-large
family: darwin
- name: macos-14-xlarge
family: darwin-arm64
- name: macos-15
family: darwin-arm64
- name: windows-2022
family: windows
- name: windows-2025
family: windows
task:
- name: Clippy
command: |
cargo hack clippy --each-feature --no-dev-deps -- -D warnings
cargo clippy --tests --benches -- -D warnings
- name: Test
command: cargo test
os:
- ubuntu-22.04
- ubuntu-24.04
- macos-15-intel
- macos-14
- macos-15
- windows-2022
- windows-2025
task:
- name: Clippy
command: |
cargo hack clippy --each-feature --no-dev-deps -- -D warnings
cargo clippy --tests --benches -- -D warnings
- name: Test
command: cargo test
include:
- os:
family: ubuntu
build_deps: scripts/workflows/provision-linux-build.sh
- os:
family: darwin
build_deps: scripts/workflows/provision-darwin-build.sh
- os:
family: darwin-arm64
build_deps: scripts/workflows/provision-darwin-arm64-build.sh
- os:
family: windows
build_deps: scripts/workflows/provision-windows-build.ps1
# formatting doesn't depend on build environment, not included in main matrix
- task:
name: Format
command: cargo fmt -- --check
os:
name: ubuntu-latest
family: ubuntu
os: ubuntu-latest
env:
VCPKG_ROOT: 'C:\vcpkg'
steps:
Expand All @@ -65,10 +42,11 @@ jobs:
~/.cargo/git
target
${{ env.VCPKG_ROOT }}
key: ${{ matrix.os.name }}-cargo-${{ hashFiles('**/Cargo.lock', 'rust-toolchain.toml') }}-ci-1
key: ${{ matrix.os }}-cargo-${{ hashFiles('**/Cargo.lock', 'rust-toolchain.toml') }}-ci-1

- name: Install dependencies
run: ${{ matrix.build_deps }}
- name: Install libudev (Linux)
if: ${{ contains(matrix.os, 'ubuntu') }}
run: sudo apt-get install -y libudev-dev

- uses: taiki-e/install-action@v2
with:
Expand Down
78 changes: 19 additions & 59 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,14 @@ on:
pull_request:

jobs:
build:
name: e2e build (${{ matrix.os }})
test:
name: e2e (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# windows not supported by dfx
include:
- os: ubuntu-22.04
binary_path: target/release
build_deps: scripts/workflows/provision-linux-build.sh
- os: macos-14-large
binary_path: target/release
build_deps: scripts/workflows/provision-darwin-build.sh
os: [ubuntu-22.04, macos-15]
steps:
- uses: actions/checkout@v4

Expand All @@ -32,64 +26,30 @@ jobs:
target
key: ${{ matrix.os }}-cargo-${{ hashFiles('**/Cargo.lock', 'rust-toolchain.toml') }}-ci-1

- name: Install dependencies
run: ${{ matrix.build_deps }}
- name: Install libudev (Linux)
if: ${{ contains(matrix.os, 'ubuntu') }}
run: sudo apt-get install -y libudev-dev

- name: Build release
run: cargo build --release --locked

- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: quill-${{ matrix.os }}-rs
path: ${{ matrix.binary_path }}/quill

list_tests:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- id: set-matrix
run: |
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
echo "matrix<<$EOF" >> $GITHUB_OUTPUT
scripts/workflows/e2e-matrix.py >> $GITHUB_OUTPUT
echo "$EOF" >> $GITHUB_OUTPUT
cargo build --release --locked
echo "$(pwd)/target/release" >> "$GITHUB_PATH"

test:
runs-on: ${{ matrix.os }}
needs: [build, list_tests]
strategy:
fail-fast: false
matrix: ${{fromJson(needs.list_tests.outputs.matrix)}}
env:
E2E_TEST: tests-${{ matrix.test }}.bash
steps:
- uses: actions/checkout@v4
- name: Download quill binary
uses: actions/download-artifact@v4
with:
name: quill-${{ matrix.os }}-rs
path: /usr/local/bin
- name: Setup quill binary
run: chmod +x /usr/local/bin/quill
- name: Install dfx
uses: dfinity/setup-dfx@main
- name: Provision Darwin

- name: Install coreutils (macOS)
if: ${{ contains(matrix.os, 'macos') }}
run: bash scripts/workflows/provision-darwin-e2e.sh
- name: Provision Linux
if: ${{ contains(matrix.os, 'ubuntu') }}
run: bash scripts/workflows/provision-linux-e2e.sh
- name: Prepare environment
run: |
echo "archive=$(pwd)/e2e/archive" >> "$GITHUB_ENV"
echo "assets=$(pwd)/e2e/assets" >> "$GITHUB_ENV"
echo "utils=$(pwd)/e2e/utils" >> "$GITHUB_ENV"
export -p
run: brew install coreutils

- name: Setup Bats and bats libs
id: setup-bats
uses: bats-core/bats-action@4.0.0

- name: Run e2e test
run: timeout 2100 bats "e2e/$E2E_TEST"
env:
BATS_LIB_PATH: ${{ steps.setup-bats.outputs.lib-path }}
run: timeout 2100 bats e2e/tests-quill/create_neuron.bash

aggregate:
name: e2e:required
Expand Down
14 changes: 5 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,14 @@ jobs:
name: windows
target_file: target/release/quill.exe
asset_name: quill-windows-x86_64.exe
build_deps: scripts/workflows/provision-windows-build.ps1
- os: macos-13-large
- os: macos-15-intel
name: macos
target_file: target/release/quill
asset_name: quill-macos-x86_64
build_deps: scripts/workflows/provision-darwin-build.sh
- os: macos-13-xlarge
- os: macos-15
name: macos-arm64
target_file: target/release/quill
asset_name: quill-macos-arm64
build_deps: scripts/workflows/provision-darwin-arm64-build.sh
- os: ubuntu-22.04
name: linux-arm32
target: arm-unknown-linux-gnueabihf
Expand All @@ -48,7 +45,6 @@ jobs:
name: linux
target_file: target/release/quill
asset_name: quill-linux-x86_64
build_deps: scripts/workflows/provision-linux-build.sh
env:
VCPKG_ROOT: 'C:\vcpkg'
steps:
Expand All @@ -62,9 +58,9 @@ jobs:
${{ env.VCPKG_ROOT }}
key: ${{ matrix.os }}-cargo-${{ env.rust }}-release-1

- name: Install dependencies
if: ${{ matrix.build_deps }}
run: ${{ matrix.build_deps }}
- name: Install libudev (Linux)
if: ${{ contains(matrix.os, 'ubuntu') }}
run: sudo apt-get install -y libudev-dev

- name: Install target
if: ${{ matrix.target }}
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/shellcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ jobs:
| xz -d | tar x
- name: Check e2e scripts
run: $HOME/bin/shellcheck-v0.7.1/shellcheck e2e/**/*.*sh
- name: Check deploy scripts
run: $HOME/bin/shellcheck-v0.7.1/shellcheck scripts/**/*.sh

aggregate:
name: shellcheck:required
Expand Down
Loading
Loading