Skip to content

Commit

Permalink
Merge pull request #93 from ably-labs/46-spec-coverage
Browse files Browse the repository at this point in the history
[ECO-4980] Add a script to show spec coverage
  • Loading branch information
lawrence-forooghian authored Oct 31, 2024
2 parents 21956dc + 59cdb3b commit c485d38
Show file tree
Hide file tree
Showing 6 changed files with 480 additions and 3 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,21 @@ jobs:

- run: swift run BuildTool lint

spec-coverage:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4

# This step can be removed once the runners’ default version of Xcode is 16 or above
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 16

- name: Spec coverage
run: swift run BuildTool spec-coverage
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

generate-matrices:
runs-on: macos-latest
outputs:
Expand Down Expand Up @@ -116,6 +131,7 @@ jobs:
runs-on: ubuntu-latest
needs:
- lint
- spec-coverage
- check-spm
- check-xcode
- check-example-app
Expand Down
11 changes: 10 additions & 1 deletion AblyChat.xcworkspace/xcshareddata/swiftpm/Package.resolved
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"originHash" : "4a28f4c041628961c5cac754904f5f76c33935bbc8417b2e036e0ab6c33b7a0a",
"originHash" : "a296396707b7685153f4cf548f6281f483d562002fe11235f1fc3bb053be91d7",
"pins" : [
{
"identity" : "ably-cocoa",
Expand Down Expand Up @@ -54,6 +54,15 @@
"revision" : "3d2dc41a01f9e49d84f0a3925fb858bed64f702d",
"version" : "1.1.2"
}
},
{
"identity" : "table",
"kind" : "remoteSourceControl",
"location" : "https://github.com/JanGorman/Table.git",
"state" : {
"revision" : "7b8521c3b1078ba0b347964aec7c503cd6f1ff40",
"version" : "1.1.1"
}
}
],
"version" : 3
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func test3 { … }
func test4 { }
```

In [#46](https://github.com/ably-labs/ably-chat-swift/issues/46), we’ll write a script that uses these tags to generate a report about how much of the feature spec we’ve implemented.
You can run `swift run BuildTool spec-coverage` to generate a report about how many spec points have been implemented and/or tested. This script is also run in CI by the `spec-coverage` job. This script will currently only detect a spec point attribution tag if it’s written exactly as shown above; that is, in a `//` comment with a single space between each component of the tag.

#### Marking a spec point as untested

Expand Down
11 changes: 10 additions & 1 deletion Package.resolved
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"originHash" : "48d264bc362ab438d94b78732ce83d1971c3a1264d089085edd3814083479fc6",
"originHash" : "f00ee2e8c80adfe8d72deb089738cdb967aeae43e71837f90d99fc602728fe45",
"pins" : [
{
"identity" : "ably-cocoa",
Expand Down Expand Up @@ -54,6 +54,15 @@
"revision" : "3d2dc41a01f9e49d84f0a3925fb858bed64f702d",
"version" : "1.1.2"
}
},
{
"identity" : "table",
"kind" : "remoteSourceControl",
"location" : "https://github.com/JanGorman/Table.git",
"state" : {
"revision" : "7b8521c3b1078ba0b347964aec7c503cd6f1ff40",
"version" : "1.1.1"
}
}
],
"version" : 3
Expand Down
8 changes: 8 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ let package = Package(
url: "https://github.com/apple/swift-async-algorithms",
from: "1.0.1"
),
.package(
url: "https://github.com/JanGorman/Table.git",
from: "1.1.1"
),
],
targets: [
.target(
Expand Down Expand Up @@ -67,6 +71,10 @@ let package = Package(
name: "AsyncAlgorithms",
package: "swift-async-algorithms"
),
.product(
name: "Table",
package: "Table"
),
]
),
]
Expand Down
Loading

0 comments on commit c485d38

Please sign in to comment.