Skip to content

Commit

Permalink
Add use of a Swift Package to test caching
Browse files Browse the repository at this point in the history
https://bugs.swift.org/browse/SR-11760 might be caused by the loss of fractional timestamps. actions/toolkit#475 should store fractional timestamps as part of the cache, but has not been merged yet.

I expect the cache to not reduce the runtime currently.
  • Loading branch information
JosephDuffy committed Jun 2, 2020
1 parent 2f8312f commit 6edc828
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/swiftpm-cache-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Test SwiftPM Cache

on:
push:

jobs:
run_xcutils:
name: Run xcutils select --print-versions
runs-on: macos-latest
strategy:
matrix:
xcode: ["11.5"]

steps:
- uses: actions/checkout@v2

- name: Select Xcode ${{ matrix.xcode }}
run: sudo xcode-select --switch /Applications/Xcode_${{ matrix.xcode }}.app

- name: Cache SwiftPM
uses: actions/cache@v2
with:
path: .build
key: ${{ runner.os }}-xcode_${{ matrix.xcode }}-swiftpm-ci-deps-${{ github.workspace }}-${{ hashFiles('Package.resolved') }}
restore-keys: |
${{ runner.os }}-xcode_${{ matrix.xcode }}-swiftpm-ci-deps-${{ github.workspace }}
- name: Run Tests
run: swift run --configuration release --skip-update xcutils select --print-versions
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/.build
34 changes: 34 additions & 0 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"object": {
"pins": [
{
"package": "swift-argument-parser",
"repositoryURL": "https://github.com/apple/swift-argument-parser",
"state": {
"branch": null,
"revision": "223d62adc52d51669ae2ee19bdb8b7d9fd6fcd9c",
"version": "0.0.6"
}
},
{
"package": "Version",
"repositoryURL": "https://github.com/mxcl/Version.git",
"state": {
"branch": null,
"revision": "200046c93f6d5d78a6d72bfd9c0b27a95e9c0a2b",
"version": "1.2.0"
}
},
{
"package": "xcutils",
"repositoryURL": "https://github.com/JosephDuffy/xcutils.git",
"state": {
"branch": null,
"revision": "0454a5dd89b680a841ada3138cd90f6c606b2d28",
"version": "0.1.0"
}
}
]
},
"version": 1
}
15 changes: 15 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// swift-tools-version:5.2
import PackageDescription

let package = Package(
name: "CIDependencies",
platforms: [
.macOS(.v10_10),
],
dependencies: [
.package(url: "https://github.com/JosephDuffy/xcutils.git", from: "0.1.0"),
],
targets: [
.target(name: "CIDependencies")
]
)
1 change: 1 addition & 0 deletions Sources/CIDependencies/Empty.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// An empty file to make this a valid target

0 comments on commit 6edc828

Please sign in to comment.