Skip to content

Commit

Permalink
chore: hakari + better drop
Browse files Browse the repository at this point in the history
  • Loading branch information
zeeshanlakhani committed Jan 25, 2024
1 parent d565307 commit 637ff20
Show file tree
Hide file tree
Showing 21 changed files with 1,349 additions and 92 deletions.
28 changes: 28 additions & 0 deletions .config/hakari.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This file contains settings for `cargo hakari`.
# See https://docs.rs/cargo-hakari/latest/cargo_hakari/config for a full list of options.

hakari-package = "homestar-workspace-hack"

# Format version for hakari's output. Version 4 requires cargo-hakari 0.9.22 or above.
dep-format-version = "4"

# Setting workspace.resolver = "2" in the root Cargo.toml is HIGHLY recommended.
# Hakari works much better with the new feature resolver.
# For more about the new feature resolver, see:
# https://blog.rust-lang.org/2021/03/25/Rust-1.51.0.html#cargos-new-feature-resolver
resolver = "2"

# Add triples corresponding to platforms commonly used by developers here.
# https://doc.rust-lang.org/rustc/platform-support.html
platforms = [
"wasm32-unknown-unknown",
"wasm32-wasi",
"x86_64-apple-darwin",
"aarch64-apple-darwin",
"x86_64-unknown-linux-gnu",
"x86_64-unknown-linux-musl",
"aarch64-unknown-linux-musl",
]

# Write out exact versions rather than a semver range. (Defaults to false.)
# exact-versions = true
41 changes: 27 additions & 14 deletions .github/workflows/tests_and_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: 🧪 Tests and Checks

on:
push:
branches: [ main ]
branches: [main]

pull_request:
branches: [ '**' ]
branches: ["**"]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -48,8 +48,8 @@ jobs:
needs: changes
if: ${{ needs.changes.outputs.rust == 'true' || needs.changes.outputs.examples == 'true' }}
env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -90,12 +90,25 @@ jobs:
- name: Run Linter
run: cargo clippy --all -- -D warnings

# TODO: Return upon new version.
# - name: Verify Publishing of crates
# uses: katyo/publish-crates@v2
# if: ${{ matrix.rust-toolchain == 'stable' }}
# with:
# dry-run: true
- name: Install cargo-hakari
if: ${{ matrix.rust-toolchain == 'stable' }}
uses: taiki-e/install-action@v2
with:
tool: cargo-hakari

- name: Check workspace-hack Cargo.toml is up-to-date
if: ${{ matrix.rust-toolchain == 'stable' }}
run: cargo hakari generate --diff

- name: Check Crates Depend on workspace-hack
if: ${{ matrix.rust-toolchain == 'stable' }}
run: cargo hakari manage-deps --dry-run

- name: Verify Publishing of crates
uses: katyo/publish-crates@v2
if: ${{ matrix.rust-toolchain == 'stable' }}
with:
dry-run: true

# Only "test" release build on push event.
- name: Test Release
Expand Down Expand Up @@ -140,8 +153,8 @@ jobs:
needs: changes
if: ${{ needs.changes.outputs.rust == 'true' }}
env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -283,8 +296,8 @@ jobs:
needs: changes
if: ${{ needs.changes.outputs.rust == 'true' }}
env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
Expand Down
Loading

0 comments on commit 637ff20

Please sign in to comment.