Skip to content

build: added developing with VSCode support #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
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
45 changes: 45 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"name": "Swift",
"image": "swift:5.6-focal",
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": "false",
"username": "vscode",
"userUid": "1000",
"userGid": "1000",
"upgradePackages": "false"
},
"ghcr.io/devcontainers/features/git:1": {
"version": "os-provided",
"ppa": "false"
}
},
"runArgs": [
"--cap-add=SYS_PTRACE",
"--security-opt",
"seccomp=unconfined"
],
// Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
// Set *default* container specific settings.json values on container create.
"settings": {
"lldb.library": "/usr/lib/liblldb.so"
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"sswg.swift-lang",
"vadimcn.vscode-lldb"
]
}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [8080],

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "swift --version",

// Set `remoteUser` to `root` to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode"
}
147 changes: 80 additions & 67 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,29 @@ concurrency:
cancel-in-progress: true

jobs:
# analyze:
# name: Analyze
# if: github.event_name != 'workflow_dispatch'
# uses: SwiftyLab/ci/.github/workflows/codeql-analysis.yml@main
# permissions:
# actions: read
# contents: read
# security-events: write
analyze:
name: Analyze
if: github.event_name != 'workflow_dispatch'
uses: SwiftyLab/ci/.github/workflows/analyze.yml@swift-codeql
permissions:
actions: read
contents: read
security-events: write
with:
matrix: >
{
"include": [
{
"os": "ubuntu-latest",
"language": "swift",
"swift": "5.7"
},
{
"os": "macos-latest",
"language": "swift"
}
]
}

# spell-check:
# name: Run spell check
Expand All @@ -44,66 +59,64 @@ jobs:
# with:
# config_path: .github/config/spellcheck.yml

swift-package-test:
name: Swift Package
uses: SwiftyLab/ci/.github/workflows/swift-package.yml@main
secrets: inherit
with:
matrix: >
{
"include": [
{
"os": "ubuntu-latest",
"swift": "5.7"
},
{
"os": "ubuntu-20.04",
"swift": "5.6"
}
]
}
# swift-package-test:
# name: Swift Package
# uses: SwiftyLab/ci/.github/workflows/swift-package.yml@swift-codeql
# secrets: inherit
# with:
# matrix: >
# {
# "include": [
# {
# "os": "ubuntu-latest",
# "swift": "5.7"
# },
# {
# "os": "ubuntu-20.04",
# "swift": "5.6"
# }
# ]
# }

cocoapods-test:
name: CocoaPods
uses: SwiftyLab/ci/.github/workflows/cocoapods.yml@main
strategy:
matrix:
platforms: ['macos', 'ios', 'tvos']
# platforms: ['macos tvos', 'ios', 'watchos']
with:
platforms: ${{ matrix.platforms }}
# cocoapods-test:
# name: CocoaPods
# uses: SwiftyLab/ci/.github/workflows/cocoapods.yml@swift-codeql
# strategy:
# matrix:
# platforms: ['macos', 'ios', 'tvos']
# # platforms: ['macos tvos', 'ios', 'watchos']
# with:
# platforms: ${{ matrix.platforms }}

xcode-test:
name: Xcode
uses: SwiftyLab/ci/.github/workflows/xcode.yml@main
with:
os: macos-12
xcode: '13.3.1'
# xcode-test:
# name: Xcode
# uses: SwiftyLab/ci/.github/workflows/xcode.yml@swift-codeql
# with:
# os: macos-12
# xcode: '13.3.1'

ci:
name: CI
if: github.event_name == 'push'
needs: [swift-package-test, xcode-test, cocoapods-test]
# needs: [analyze, swift-package-test, xcode-test, cocoapods-test]
uses: SwiftyLab/ci/.github/workflows/ci.yml@main
# ci:
# name: CI
# if: github.event_name == 'push'
# needs: [analyze, swift-package-test, xcode-test, cocoapods-test]
# uses: SwiftyLab/ci/.github/workflows/ci.yml@swift-codeql

cd:
name: CD
if: |
(github.event_name == 'push' && needs.ci.outputs.release == 'true') ||
(always() &&
github.event_name == 'workflow_dispatch' &&
github.event.inputs.release == 'true' &&
needs.swift-package-test.result == 'success' &&
needs.xcode-test.result == 'success' &&
needs.cocoapods-test.result == 'success' &&
(needs.ci.result == 'success' || needs.ci.result == 'skipped'))
# (needs.analyze.result == 'success' || needs.analyze.result == 'skipped')
needs: [ci, swift-package-test, xcode-test, cocoapods-test]
# needs: [ci, analyze, swift-package-test, xcode-test, cocoapods-test]
uses: SwiftyLab/ci/.github/workflows/cd.yml@main
with:
os: macos-12
version: ${{ github.event.inputs.version }}
secrets:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
# cd:
# name: CD
# if: |
# (github.event_name == 'push' && needs.ci.outputs.release == 'true') ||
# (always() &&
# github.event_name == 'workflow_dispatch' &&
# github.event.inputs.release == 'true' &&
# needs.swift-package-test.result == 'success' &&
# needs.xcode-test.result == 'success' &&
# needs.cocoapods-test.result == 'success' &&
# (needs.ci.result == 'success' || needs.ci.result == 'skipped')) &&
# (needs.analyze.result == 'success' || needs.analyze.result == 'skipped')
# needs: [ci, analyze, swift-package-test, xcode-test, cocoapods-test]
# uses: SwiftyLab/ci/.github/workflows/cd.yml@swift-codeql
# with:
# os: macos-12
# version: ${{ github.event.inputs.version }}
# secrets:
# COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"sswg.swift-lang",
"vadimcn.vscode-lldb",
"ms-vscode-remote.vscode-remote-extensionpack"
]
}
9 changes: 9 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,14 @@
"**/.docc-build": true,
"**/node_modules": true,
"Package.resolved": true
},
"swift.swiftEnvironmentVariables": {
"ASYNCOBJECTS_ENABLE_DEV": "1",
"ASYNCOBJECTS_USE_CHECKEDCONTINUATION": "1",
"SWIFTCI_CONCURRENCY_CHECKS": "1",
"ASYNCOBJECTS_ENABLE_LOGGING_LEVEL": "INFO"
},
"swift.testEnvironmentVariables": {
"LIBDISPATCH_COOPERATIVE_POOL_STRICT": "1"
}
}
27 changes: 27 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "swift: Build All",
"detail": "swift build --build-tests",
"cwd": ".",
"type": "swift",
"args": [
"build",
"--build-tests"
],
"problemMatcher": [
"$swiftc"
],
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"reveal": "silent",
"panel": "shared",
"clear": true
}
}
]
}
1 change: 1 addition & 0 deletions AsyncObjects.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Pod::Spec.new do |s|
}

s.dependency 'OrderedCollections', '~> 1.0.0'
s.dependency 'AsyncAlgorithms', '~> 0.1.0'
s.default_subspecs = :none

s.subspec 'Checked' do |ss|
Expand Down
26 changes: 26 additions & 0 deletions AsyncObjects.xcodeproj/AsyncAlgorithms_Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>2.1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string/>
</dict>
</plist>
26 changes: 26 additions & 0 deletions AsyncObjects.xcodeproj/Collections_Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>2.1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string/>
</dict>
</plist>
26 changes: 26 additions & 0 deletions AsyncObjects.xcodeproj/DequeModule_Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>2.1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string/>
</dict>
</plist>
Loading