Skip to content

NanoTDF Collection

NanoTDF Collection #92

Workflow file for this run

name: Swift
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
env:
DERIVED_DATA_PATH: ".build"
jobs:
lint:
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Print Swift version
run: swift --version
- name: Install SwiftFormat
run: brew install swiftformat
- name: Run SwiftFormat
run: swiftformat --swiftversion 6.2 . --lint
# - name: Run SwiftLint
# run: swiftlint --strict
build:
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Print Swift version
run: swift --version
- name: Cache Swift packages
id: cache-swift
uses: actions/cache@v4
with:
path: |
.build
~/.swiftpm
key: ${{ runner.os }}-swift-${{ hashFiles('Package.swift') }}
restore-keys: |
${{ runner.os }}-swift-
- name: Build Debug
run: swift build -v
- name: Build Release
run: swift build -c release -v
test:
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Print Swift version
run: swift --version
- name: Cache Swift packages
id: cache-swift
uses: actions/cache@v4
with:
path: |
.build
~/.swiftpm
key: ${{ runner.os }}-swift-${{ hashFiles('Package.swift') }}
restore-keys: |
${{ runner.os }}-swift-
- name: Run tests
run: swift test
benchmark:
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Print Swift version
run: swift --version
- name: Cache Swift packages
id: cache-swift
uses: actions/cache@v4
with:
path: |
.build
~/.swiftpm
key: ${{ runner.os }}-swift-${{ hashFiles('Package.swift') }}
restore-keys: |
${{ runner.os }}-swift-
- name: Run KeyStore Benchmarks
run: swift test --configuration release --filter KeyStoreBenchmarkTests | tee keystore-benchmark.log
- name: Run KASService Benchmarks
run: swift test --configuration release --filter KASServiceBenchmarkTests | tee kasservice-benchmark.log
- name: Run NanoTDF Benchmarks
run: swift test --configuration release --filter NanoTDFBenchmarkTests | tee nanotdf-benchmark.log
- name: Upload benchmark logs
uses: actions/upload-artifact@v4
with:
name: benchmark-results
path: |
*-benchmark.log
retention-days: 7