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
33 changes: 0 additions & 33 deletions .github/workflows/build.yml

This file was deleted.

40 changes: 40 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: CI / Run Tests

on:
pull_request:
branches: [ "main" ]
push:
branches: [ "main" ]

jobs:
test:
name: Build and Test
runs-on: macos-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up Java 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'zulu'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
# Caches your gradle dependencies so future builds are much faster
cache-read-only: ${{ github.ref != 'refs/heads/main' }}

- name: Run All Tests
run: ./gradlew check --no-configuration-cache

- name: Generate Summary
if: always()
run: |
if [ "${{ job.status }}" == "success" ]; then
echo "### ✅ All tests passed successfully!" >> $GITHUB_STEP_SUMMARY
else
echo "### ❌ Tests failed. Please check the logs." >> $GITHUB_STEP_SUMMARY
fi
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package io.github.developrofthings.kapacity.io
import io.github.developrofthings.kapacity.Kapacity
import io.github.developrofthings.kapacity.byte
import java.io.File
import java.nio.ByteBuffer
import java.nio.file.Path
import kotlin.io.path.fileSize

Expand All @@ -19,4 +20,9 @@ val File.kapacity: Kapacity get() = this.length().byte
*
* If the file does not exist, throws an exception matching the underlying behavior of [Path.fileSize].
*/
val Path.kapacity: Kapacity get() = this.fileSize().byte
val Path.kapacity: Kapacity get() = this.fileSize().byte

/**
* Returns the [Kapacity] of this [ByteBuffer], calculated directly from its length on the disk.
*/
val ByteBuffer.kapacity: Kapacity get() = this.capacity().byte
Loading
Loading