Skip to content

Commit

Permalink
Merge pull request #23 from LebJe/UpdateWorkflows
Browse files Browse the repository at this point in the history
Update Workflows
  • Loading branch information
LebJe authored Dec 10, 2023
2 parents 2836432 + 14f7844 commit b3daf53
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 48 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/buildAndTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ name: "Build and Test"
on: ["push", "pull_request"]

jobs:
TestOnMacOS-11_0-x86_64:
runs-on: "macos-11"
TestOnMacOS-Latest-x86_64:
runs-on: "macos-latest"
steps:
- uses: "actions/checkout@v3"
- uses: "actions/checkout@v4"
- name: "Run tests"
run: "swift test"
# TestOnUbuntu-20_04-ARM:
Expand All @@ -29,23 +29,23 @@ jobs:
TestOnUbuntu-20_04-x86_64:
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v3"
- uses: "actions/checkout@v4"
- name: "Run tests"
run: "swift test"
TestOnWindows10-x86_64:
runs-on: "windows-latest"
steps:
- uses: "actions/checkout@v3"
- uses: "actions/checkout@v4"
- uses: "seanmiddleditch/gha-setup-vsdevenv@master"
- uses: "compnerd/gha-setup-swift@main"
with:
branch: "swift-5.6-release"
tag: "5.6-RELEASE"
branch: "swift-5.8-release"
tag: "5.8-RELEASE"
- name: "Test"
run: "swift test -Xcc -D_ALLOW_COMPILER_AND_STL_VERSION_MISMATCH -Xcxx -D_ALLOW_COMPILER_AND_STL_VERSION_MISMATCH"
TestBuildingOnMacOS-11_0-ARM64:
runs-on: "macos-11"
TestBuildingOnMacOS-Latest-ARM64:
runs-on: "macos-latest"
steps:
- uses: "actions/checkout@v3"
- uses: "actions/checkout@v4"
- name: "Run tests"
run: "swift build --arch arm64"
29 changes: 10 additions & 19 deletions .github/workflows/generateDocumentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,20 @@ jobs:
"GenerateDocumentation":
runs-on: "macos-latest"
steps:
- uses: "actions/checkout@v3"
- name: "Clone swift-docc and swift-docc-render"
run: "gh repo clone apple/swift-docc && gh repo clone LebJe/swift-docc-render"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- name: "Build swift-docc-render"
run: "cd swift-docc-render/ && npm install && npm run build && cd .."
- name: "Cache DocC"
id: "cache-docc"
uses: "actions/cache@v3"
with:
key: "TOMLKit-docc-build"
path: "swift-docc/.build"
- name: "Build swift-docc"
if: "${{ !steps.cache-docc.outputs.cache-hit }}"
run: "swift build --product docc --package-path swift-docc -c release"
- uses: "actions/checkout@v4"
# - name: "Clone swift-docc-render"
# run: "gh repo clone LebJe/swift-docc-render"
# env:
# GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
# - name: "Build swift-docc-render"
# run: "cd swift-docc-render/ && npm install && npm run build && cd .."
- name: "Build TOMLKit"
run: "swift build --target TOMLKit -Xswiftc -emit-symbol-graph -Xswiftc -emit-symbol-graph-dir -Xswiftc .build"
- name: "Build documentation"
run: |
export DOCC_HTML_DIR=swift-docc-render/dist
#export DOCC_HTML_DIR=swift-docc-render/dist
./swift-docc/.build/release/docc convert \
xcrun docc convert \
Sources/TOMLKit/TOMLKit.docc \
--fallback-display-name TOMLKit \
--fallback-bundle-identifier com.LebJe.TOMKit \
Expand All @@ -40,7 +31,7 @@ jobs:
--enable-inherited-docs \
--output-dir docs
./swift-docc/.build/release/docc process-archive transform-for-static-hosting docs --hosting-base-path /TOMLKit
xcrun docc process-archive transform-for-static-hosting docs --hosting-base-path /TOMLKit
- name: "Deploy to GitHub Pages"
uses: "peaceiris/actions-gh-pages@v3"
with:
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
name: "Run Pre-Commit"

on: "pull_request"
on:
push:
branches:
- "main"

jobs:
PreCommit:
runs-on: "macos-latest"
steps:
- uses: "actions/checkout@v3"
- name: "Checkout PR"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: "gh pr checkout ${{ github.event.pull_request.number }}"
- uses: "actions/checkout@v4"
- name: "Install Dependencies"
run: "brew bundle"
- uses: "LebJe/pre-commit-composite-action@0.0.1"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ Sources/TOMLKit/TOMLKit.docc/.docc-build
TOMLKit.doccarchive
docs/
.vscode
node_modules
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ repos:
- id: "swift-format"
name: "Format Swift"
- repo: "https://github.com/pre-commit/mirrors-prettier"
rev: "v2.6.1"
rev: "v4.0.0-alpha.3-1"
hooks:
- id: "prettier"
name: "Format YAML & Markdown"
Expand Down
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"trailingComma": "es5",
"tabWidth": 4,
"singleQuote": false,
"useTabs": true
}
4 changes: 0 additions & 4 deletions .prettierrc.toml

This file was deleted.

2 changes: 1 addition & 1 deletion Sources/TOMLKit/TOML Data Types/TOMLTable/TOMLTable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public final class TOMLTable:
}

/// A pointer to the underlying `toml::table`.
internal var tablePointer: OpaquePointer
var tablePointer: OpaquePointer

/// The amount of elements in the table.
public var count: Int { tableSize(self.tablePointer) }
Expand Down
10 changes: 5 additions & 5 deletions Sources/TOMLKit/TOMLParseError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ public struct TOMLSourcePosition: Equatable, CustomDebugStringConvertible {

public var debugDescription: String { "line \(self.line), column \(self.column)" }

internal init(line: Int, column: Int) {
init(line: Int, column: Int) {
self.line = line
self.column = column
}

internal init(cTOMLSourcePosition: CTOMLSourcePosition) {
init(cTOMLSourcePosition: CTOMLSourcePosition) {
self.line = Int(cTOMLSourcePosition.line)
self.column = Int(cTOMLSourcePosition.column)
}
Expand All @@ -31,12 +31,12 @@ public struct TOMLSourceRegion: Equatable, CustomDebugStringConvertible {
public let begin: TOMLSourcePosition
public let end: TOMLSourcePosition

internal init(begin: TOMLSourcePosition, end: TOMLSourcePosition) {
init(begin: TOMLSourcePosition, end: TOMLSourcePosition) {
self.begin = begin
self.end = end
}

internal init(cBegin: CTOMLSourcePosition, cEnd: CTOMLSourcePosition) {
init(cBegin: CTOMLSourcePosition, cEnd: CTOMLSourcePosition) {
self.begin = .init(cTOMLSourcePosition: cBegin)
self.end = .init(cTOMLSourcePosition: cEnd)
}
Expand All @@ -56,7 +56,7 @@ public struct TOMLParseError: Error, CustomDebugStringConvertible {
/// This documentation comment was taken from the [toml++ documentation](https://marzer.github.io/tomlplusplus/classtoml_1_1parse__error.html#a8168b4941305654cf4ba8fc96efd0514).
public let source: TOMLSourceRegion

internal init(cTOMLParseError: CTOMLParseError) {
init(cTOMLParseError: CTOMLParseError) {
self.description = String(cString: cTOMLParseError.description)
self.source = TOMLSourceRegion(cBegin: cTOMLParseError.source.begin, cEnd: cTOMLParseError.source.end)
}
Expand Down
4 changes: 2 additions & 2 deletions Sources/TOMLKit/TOMLValue/TOMLValue.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ public struct TOMLValue:
TOMLValueConvertible
{
/// The pointer to the underlying `toml::node`.
internal let tomlValuePointer: OpaquePointer
let tomlValuePointer: OpaquePointer

internal var tomlInt: TOMLInt?
var tomlInt: TOMLInt?

public var type: TOMLType {
nodeType(self.tomlValuePointer).tomlType
Expand Down

0 comments on commit b3daf53

Please sign in to comment.