Skip to content

Commit

Permalink
Merge branch 'master' into spofford/clap4
Browse files Browse the repository at this point in the history
  • Loading branch information
adamspofford-dfinity committed May 21, 2024
2 parents 6df9065 + 729e56f commit af37e75
Show file tree
Hide file tree
Showing 12 changed files with 898 additions and 616 deletions.
57 changes: 39 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,56 @@
name: CI

on: pull_request

env:
rust: 1.75.0

jobs:
ci:
name: ${{ matrix.task.name }} (${{ matrix.os }})
runs-on: ${{ matrix.os }}
name: ${{ matrix.task.name }} (${{ matrix.os.name }})
runs-on: ${{ matrix.os.name }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
os:
- name: ubuntu-20.04
family: ubuntu
- name: ubuntu-22.04
family: ubuntu
- name: macos-12-large
family: darwin
- name: macos-14-large
family: darwin
- name: macos-14-xlarge
family: darwin-arm64
- name: windows-2019
family: windows
- name: windows-2022
family: windows
task:
- name: Format
command: cargo fmt -- --check
- name: Clippy
command: cargo clippy --all --all-targets --all-features --tests -- -D warnings
command: |
cargo hack clippy --each-feature --no-dev-deps -- -D warnings
cargo clippy --tests --benches -- -D warnings
- name: Test
command: cargo test
include:
- os: ubuntu-latest
- os:
family: ubuntu
build_deps: scripts/workflows/provision-linux-build.sh
- os: macos-latest
- os:
family: darwin
build_deps: scripts/workflows/provision-darwin-build.sh
- os: windows-latest
- 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-20.04
family: ubuntu
env:
VCPKG_ROOT: 'C:\vcpkg'
steps:
Expand All @@ -39,17 +63,14 @@ jobs:
~/.cargo/git
target
${{ env.VCPKG_ROOT }}
key: ${{ matrix.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-${{ env.rust }}-ci-1
key: ${{ matrix.os.name }}-cargo-${{ hashFiles('**/Cargo.lock', 'rust-toolchain.toml') }}-ci-1

- name: Install dependencies
run: ${{ matrix.build_deps }}

- uses: actions-rs/toolchain@v1
- uses: taiki-e/install-action@v2
with:
profile: minimal
toolchain: ${{ env.rust }}
override: true
components: rustfmt, clippy
tool: [email protected]

- name: ${{ matrix.task.name }}
run: ${{ matrix.task.command }}
Expand Down
19 changes: 5 additions & 14 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ on:
- master
pull_request:

env:
rust: 1.75.0

jobs:
build:
name: e2e build (${{ matrix.os }})
Expand All @@ -18,10 +15,10 @@ jobs:
matrix:
# windows not supported by dfx
include:
- os: ubuntu-latest
- os: ubuntu-22.04
binary_path: target/release
build_deps: scripts/workflows/provision-linux-build.sh
- os: macos-latest
- os: macos-14-large
binary_path: target/release
build_deps: scripts/workflows/provision-darwin-build.sh
steps:
Expand All @@ -33,14 +30,8 @@ jobs:
~/.cargo/git
~/.cargo/registry
target
key: ${{ matrix.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-${{ env.rust }}-ci-1
key: ${{ matrix.os }}-cargo-${{ hashFiles('**/Cargo.lock', 'rust-toolchain.toml') }}-ci-1

- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ env.rust }}
override: true
# components: rustfmt, clippy
- name: Install dependencies
run: ${{ matrix.build_deps }}

Expand All @@ -50,7 +41,7 @@ jobs:
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: quill-${{ matrix.os }}-rs-${{ env.rust }}
name: quill-${{ matrix.os }}-rs
path: ${{ matrix.binary_path }}/quill

list_tests:
Expand Down Expand Up @@ -79,7 +70,7 @@ jobs:
- name: Download quill binary
uses: actions/download-artifact@v2
with:
name: quill-${{ matrix.os }}-rs-${{ env.rust }}
name: quill-${{ matrix.os }}-rs
path: /usr/local/bin
- name: Setup quill binary
run: chmod +x /usr/local/bin/quill
Expand Down
23 changes: 12 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,29 @@ jobs:
target_file: target/x86_64-unknown-linux-musl/release/quill
asset_name: quill-linux-x86_64-musl
features: []
- os: windows-latest
- os: windows-2019
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-latest
- os: macos-12-large
name: macos
target_file: target/release/quill
asset_name: quill-macos-x86_64
build_deps: scripts/workflows/provision-darwin-build.sh
- os: ubuntu-latest
- os: macos-13-xlarge
name: macos-arm64
target_file: target/release/quill
asset_name: quill-macos-arm64
build_deps: scripts/workflows/provision-darwin-arm64-build.sh
- os: ubuntu-20.04
name: linux-arm32
target: arm-unknown-linux-gnueabihf
cross: true
target_file: target/arm-unknown-linux-gnueabihf/release/quill
asset_name: quill-linux-arm32
features: [hsm]
- os: ubuntu-latest
- os: ubuntu-20.04
name: linux
target_file: target/release/quill
asset_name: quill-linux-x86_64
Expand All @@ -63,13 +68,9 @@ jobs:
if: ${{ matrix.build_deps }}
run: ${{ matrix.build_deps }}

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ env.rust }}
override: true
target: ${{ matrix.target }}
- name: Install target
if: ${{ matrix.target }}
run: rustup target add ${{ matrix.target }}

- name: Build
uses: actions-rs/cargo@v1
Expand Down
Loading

0 comments on commit af37e75

Please sign in to comment.