Skip to content
Open
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
72 changes: 34 additions & 38 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,50 +2,46 @@ name: build

on:
push:
branches: [ master ]
branches: [master]
pull_request:
branches: [ master ]
branches: [master]

env:
CARGO_TERM_COLOR: always

jobs:
build:

check:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable

- name: Cache cargo dir
uses: actions/cache@v4
env:
cache-name: cache-cargo-dir
with:
path: ~/.cargo
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-

- name: Cache target dir
uses: actions/cache@v4
env:
cache-name: cache-target-dir
with:
path: ./target
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-

- run: cargo install cargo-readme

- run: make ci
name: 'Running `make ci`'
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
- run: cargo install cargo-readme
- name: "Running `make ci`"
run: make check

test:
needs: check
strategy:
matrix:
target:
- { name: Linux, os: ubuntu-latest, triple: x86_64-unknown-linux-gnu }
# - { name: macOS, os: macos-latest, triple: x86_64-apple-darwin }
- { name: Windows, os: windows-2022, triple: x86_64-pc-windows-msvc }
version:
- 1.76.0 # MSRV
- stable
- nightly
runs-on: ${{ matrix.target.os }}
name: ${{ matrix.target.name }} / ${{ matrix.version }}
steps:
- uses: actions/checkout@v4
- name: Install ${{ matrix.version }}
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ matrix.version }}-${{ matrix.target.triple }}
override: true
- name: Run tests
run: make tests examples
24 changes: 24 additions & 0 deletions .github/workflows/tag_publish
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Cargo Publish

on:
release:
types: [created]

jobs:
publish:
name: publish ${{ matrix.target }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
override: true
- uses: katyo/publish-crates@v2
with:
path: './kash_macros'
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
- uses: katyo/publish-crates@v2
with:
path: '.'
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
2 changes: 1 addition & 1 deletion src/stores/disk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ mod test_DiskCache {
// we should design the tests to run all the same tests but parameterized with different conditions.
fn does_not_break_when_constructed_using_default_disk_directory() {
let cache: DiskCache<u32, u32> =
DiskCache::new(&format!("{}:disk-cache-test-default-dir", now_millis()))
DiskCache::new(&format!("{}_disk-cache-test-default-dir", now_millis()))
// use the default disk directory
.build()
.unwrap();
Expand Down