Skip to content

Commit

Permalink
Merge pull request #44 from taji-taji/dev-tools
Browse files Browse the repository at this point in the history
Dev tools
  • Loading branch information
taji-taji authored Sep 4, 2022
2 parents 33f2d07 + 16d3599 commit 4e7c887
Show file tree
Hide file tree
Showing 6 changed files with 100 additions and 5 deletions.
36 changes: 32 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,33 @@ jobs:
id: get-swift-version
run: |
echo "::set-output name=version::$(swift -version | head -n 1 | sed s/,// )"
- name: Cache DevTools
uses: actions/cache@v2
with:
path: |
./DevTools/.build/release
key: ${{ runner.os }}-DevTools-${{ matrix.xcode }}-${{ hashFiles('./DevTools/Package.resolved') }}
restore-keys: |
${{ runner.os }}-DevTools-${{ matrix.xcode }}-${{ hashFiles('./DevTools/Package.resolved') }}
${{ runner.os }}-DevTools-${{ matrix.xcode }}-
- name: Install DevTools
run: |
if [ ! -e ./DevTools/.build/release/xcbeautify ]; then
make dev
fi
- name: Cache dependencies
uses: actions/cache@v2
with:
path: |
.build/artifacts
.build/checkouts
.build/repositories
key: ${{ runner.os }}-dependencies-${{ matrix.xcode }}-${{ hashFiles('**/Package.resolved') }}
key: ${{ runner.os }}-dependencies-${{ matrix.xcode }}-${{ hashFiles('./Package.resolved') }}
restore-keys: |
${{ runner.os }}-dependencies-${{ matrix.xcode }}-${{ hashFiles('**/Package.resolved') }}
${{ runner.os }}-dependencies-${{ matrix.xcode }}-${{ hashFiles('./Package.resolved') }}
${{ runner.os }}-dependencies-${{ matrix.xcode }}-
- name: Test
run: swift test
run: make test
linux:
strategy:
fail-fast: false
Expand All @@ -66,6 +80,20 @@ jobs:
run: |
echo "::set-output name=version::$(swift -version | head -n 1 | sed s/,// )"
shell: bash
- name: Cache DevTools
uses: actions/cache@v2
with:
path: |
./DevTools/.build/release
key: ${{ matrix.cache-version }}-${{ runner.os }}-${{ steps.get-swift-version.outputs.version }}}-DevTools-${{ hashFiles('./DevTools/Package.resolved') }}
restore-keys: |
${{ matrix.cache-version }}-${{ runner.os }}-${{ steps.get-swift-version.outputs.version }}}-DevTools-${{ hashFiles('./DevTools/Package.resolved') }}
${{ matrix.cache-version }}-${{ runner.os }}-${{ steps.get-swift-version.outputs.version }}}-DevTools-
- name: Install DevTools
run: |
if [ ! -e ./DevTools/.build/release/xcbeautify ]; then
make dev
fi
- name: Cache dependencies
uses: actions/cache@v2
with:
Expand All @@ -77,5 +105,5 @@ jobs:
restore-keys: |
${{ matrix.cache-version }}-${{ runner.os }}-${{ steps.get-swift-version.outputs.version }}-spm-deps-
- name: Test
run: swift test
run: make test

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.DS_Store
/.build
/**/.build
/Packages
/*.xcodeproj
xcuserdata/
Expand Down
Empty file added DevTools/Dummy.swift
Empty file.
43 changes: 43 additions & 0 deletions DevTools/Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"object": {
"pins": [
{
"package": "Colorizer",
"repositoryURL": "https://github.com/getGuaka/Colorizer.git",
"state": {
"branch": null,
"revision": "2ccc99bf1715e73c4139e8d40b6e6b30be975586",
"version": "0.2.1"
}
},
{
"package": "swift-argument-parser",
"repositoryURL": "https://github.com/apple/swift-argument-parser.git",
"state": {
"branch": null,
"revision": "9f39744e025c7d377987f30b03770805dcb0bcd1",
"version": "1.1.4"
}
},
{
"package": "xcbeautify",
"repositoryURL": "https://github.com/tuist/xcbeautify",
"state": {
"branch": null,
"revision": "a3f5db18e7218a3817031b1b8227b1cb5704cb93",
"version": "0.13.0"
}
},
{
"package": "XMLCoder",
"repositoryURL": "https://github.com/MaxDesiatov/XMLCoder.git",
"state": {
"branch": null,
"revision": "ca932442d7481700f5434a7b138c47dd42d9902b",
"version": "0.14.0"
}
}
]
},
"version": 1
}
13 changes: 13 additions & 0 deletions DevTools/Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// swift-tools-version: 5.5
import PackageDescription

let package = Package(
name: "DevTools",
platforms: [.macOS(.v10_11)],
dependencies: [
.package(url: "https://github.com/tuist/xcbeautify", from: "0.13.0"),
],
targets: [
.target(name: "DevTools", path: "")
]
)
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
SWIFT = $(shell which swift)
DEV_TOOLS_BUILD_FLAGS = --configuration release --package-path ./DevTools
XCBEAUTIFY_EXECUTABLE = ./DevTools/.build/release/xcbeautify

.PHONY: dev
dev:
$(SWIFT) build $(DEV_TOOLS_BUILD_FLAGS) --product xcbeautify

.PHONY: test
test:
$(SWIFT) test 2>&1 | $(XCBEAUTIFY_EXECUTABLE)

0 comments on commit 4e7c887

Please sign in to comment.