-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
124 lines (122 loc) · 3.95 KB
/
action.yml
File metadata and controls
124 lines (122 loc) · 3.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
name: 'swift-package'
description: "Set of utils for CI of multiplatform swift packages"
author: 'capturecontext'
inputs:
xcode:
description: Xcode version
required: false
default: '26.2'
cache-derived-data:
description: "Specifies if DerivedData should be cached"
required: false
default: false
cache-derived-data-base-path:
description: "Base path for DerivedData caching"
required: false
default: ~/.derivedData
cache-derived-data-prefix:
description: "Prefix for caching key"
required: false
default: __unspecified__
cache-derived-data-suffix:
description: "Suffix for caching key, likely to be files hash"
required: false
default: __unspecified__
command:
description: "MAKE command to run"
required: false
subcommand:
description: "COMMAND argument for make action"
required: false
default: __unspecified__
workspace:
description: "Path to xcworkspace for xcodebuild actions"
required: false
default: .swiftpm/xcode/package.xcworkspace
scheme:
description: "Scheme"
required: false
default: __unspecified__
platform:
description: "Platform"
required: false
default: __unspecified__
config:
description: "Config"
required: false
default: Debug
beautify:
description: "Beautify"
required: false
default: quiet
working-directory:
description: "Where to run the action"
required: false
default: '.'
swift-format-commit-message:
description: "Commit message for format action"
required: false
default: '[swift-format]'
swift-format-branch:
description: "Branch for committing result of format action"
required: false
default: 'main'
branding:
icon: 'package'
color: 'gray-dark'
runs:
using: "composite"
steps:
- name: Setup venv
uses: capturecontext/swift-package-action/setup-venv@3.0-beta.13
- name: Select Xcode ${{ inputs.xcode }}
uses: capturecontext/swift-package-action/xcode-select@3.0-beta.13
with:
version: ${{ inputs.xcode }}
- name: Install visionOS runtime
if: inputs.platform == visionOS
uses: capturecontext/swift-package-action/install-visionos@3.0-beta.13
- name: List available devices
if: inputs.platform != '__unspecified__'
shell: bash
run: xcrun simctl list devices available
- name: Cache derived data
if: |
inputs.cache-derived-data == true ||
inputs.command == cache-derived-data
uses: capturecontext/swift-package-action/cache/derived-data@3.0-beta.13
with:
path: ${{ inputs.cache-derived-data-base-path }}
prefix: ${{ inputs.cache-derived-data-prefix }}
platform: ${{ inputs.platform }}
xcode: ${{ inputs.xcode }}
command: ${{ inputs.subcommand }}
suffix: ${{ inputs.suffix }}
- name: Set IgnoreFileSystemDeviceInodeChanges flag
shell: bash
run: defaults write com.apple.dt.XCBuild IgnoreFileSystemDeviceInodeChanges -bool YES
- name: Update mtime for incremental builds
uses: chetan/git-restore-mtime-action@v2
- name: Run ${{ inputs.command }}
if: |
inputs.command != '__unspecified__' &&
inputs.command != 'cache-derived-data'
shell: bash
run: |
# run-${{ inputs.command }} step
echo "$GITHUB_ACTION_PATH"
cd "${{ inputs.working-directory }}"
make ${{ inputs.command }} \
-f "$GITHUB_ACTION_PATH"/Makefile \
ACTION_PATH="$GITHUB_ACTION_PATH" \
WORKSPACE="${{ inputs.workspace }}" \
SCHEME="${{ inputs.scheme }}" \
PLATFORM="${{ inputs.platform }}" \
CONFIG="${{ inputs.config }}" \
BEAUTIFY="${{ inputs.beautify }}"
- name: Commit swift-format
if: inputs.command == swift-format
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: ${{ inputs.swift-format-commit-message }}
branch: ${{ inputs.swift-format-branch }}