Skip to content

Commit

Permalink
One Call API 3.0 (#13)
Browse files Browse the repository at this point in the history
Signed-off-by: Henrik Panhans <henrik@panhans.dev>
  • Loading branch information
henrik-dmg authored Oct 1, 2024
1 parent 5b4a44c commit 8d1fd56
Show file tree
Hide file tree
Showing 55 changed files with 2,958 additions and 953 deletions.
54 changes: 29 additions & 25 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,48 @@
name: Pages Deploy
name: Documentation

on:
push:
branches: [ main ]

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
branches: ["main"]
paths:
- "Sources/**/*.swift"
- "Tests/**/*.swift"
- "**/*.md"

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true

jobs:
# Single deploy job since we're just deploying
deploy:
deploy-pages:
name: Deploy Documentation to GitHub Pages
runs-on: macos-14
environment:
# Must be set to this for deploying to GitHub Pages
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: macos-12
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
- name: Configure Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Checkout Code
uses: actions/checkout@v4
- name: Cache SPM dependencies
uses: actions/cache@v4
with:
path: .build
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
restore-keys: |
${{ runner.os }}-spm-
- name: Build DocC
run: |
swift package --allow-writing-to-directory ./docs \
generate-documentation --target HPOpenWeather \
--transform-for-static-hosting \
--hosting-base-path HPOpenWeather \
--output-path ./docs
echo "<script>window.location.href += \"/documentation/hpopenweather\"</script>" > docs/index.html
run: Scripts/build-docc-archive HPOpenWeather
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
uses: actions/upload-pages-artifact@v3
with:
# Upload only docs directory
path: 'docs'
path: ${{ runner.temp }}/docs
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
uses: actions/deploy-pages@v4
79 changes: 62 additions & 17 deletions .github/workflows/swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,70 @@ name: Swift

on:
push:
branches: [ main ]
branches: [main]
paths:
- "Sources/**/*.swift"
- "Tests/**/*.swift"
pull_request:
branches: [ main ]
branches: [main]
paths:
- "Sources/**/*.swift"
- "Tests/**/*.swift"

jobs:
build:

runs-on: macos-latest

test-swift:
name: Test Swift Code
runs-on: macos-14
steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- uses: actions/checkout@v2
- name: Build
run: swift build -v
- name: Run tests
run: swift test -v
env:
- name: Configure Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Checkout Code
uses: actions/checkout@v4
- name: Cache SPM dependencies
uses: actions/cache@v4
with:
path: .build
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
restore-keys: |
${{ runner.os }}-spm-
- name: Build
run: swift build -v
- name: Run tests
run: swift test --enable-code-coverage -v
env:
API_KEY: ${{ secrets.API_KEY }}
- name: Codecov
uses: codecov/codecov-action@v2
- name: Convert coverage report
continue-on-error: true
run: Scripts/convert-coverage-report --target HPOpenWeatherPackageTests
- name: Upload coverage reports to Codecov
continue-on-error: true
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: henrik-dmg/HPOpenWeather

lint-code:
name: Lint Swift Code
runs-on: macos-14
steps:
- name: Configure Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Checkout Code
uses: actions/checkout@v4
- name: Cache SPM dependencies
uses: actions/cache@v4
with:
path: .build
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
restore-keys: |
${{ runner.os }}-spm-
- name: Install SwiftLint
run: brew install swift-format peripheryapp/periphery/periphery
- name: Lint code
run: Scripts/lint-swift-code
- name: Scan for dead code
run: periphery scan --strict --config config/periphery.yml
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,7 @@ fastlane/test_output
iOSInjectionProject/
.swiftpm
settings.json
/docs
/coverage

**/.DS_Store
15 changes: 0 additions & 15 deletions .vscode/launch.json

This file was deleted.

26 changes: 13 additions & 13 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@ appearance, race, religion, or sexual identity and orientation.
Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
- The use of sexualized language or imagery and unwelcome sexual attention or
advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic
address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Expand Down
32 changes: 0 additions & 32 deletions HPOpenWeather.podspec

This file was deleted.

114 changes: 29 additions & 85 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -1,88 +1,32 @@
{
"object": {
"pins": [
{
"package": "HPNetwork",
"repositoryURL": "https://github.com/henrik-dmg/HPNetwork",
"state": {
"branch": null,
"revision": "fba08b668713bad984ad4d76bf99b55e9192fcce",
"version": "3.1.2"
}
},
{
"package": "HPURLBuilder",
"repositoryURL": "https://github.com/henrik-dmg/HPURLBuilder",
"state": {
"branch": null,
"revision": "49ad1fb6f10914e7134dc9f8e5c21f48a52e3d37",
"version": "1.1.0"
}
},
{
"package": "swift-argument-parser",
"repositoryURL": "https://github.com/apple/swift-argument-parser.git",
"state": {
"branch": null,
"revision": "9f39744e025c7d377987f30b03770805dcb0bcd1",
"version": "1.1.4"
}
},
{
"package": "SwiftDocCPlugin",
"repositoryURL": "https://github.com/apple/swift-docc-plugin",
"state": {
"branch": "main",
"revision": "a3217706ad049ca058743003e065767773cc56cc",
"version": null
}
},
{
"package": "SymbolKit",
"repositoryURL": "https://github.com/apple/swift-docc-symbolkit",
"state": {
"branch": "main",
"revision": "b45d1f2ed151d057b54504d653e0da5552844e34",
"version": null
}
},
{
"package": "swift-format",
"repositoryURL": "https://github.com/apple/swift-format",
"state": {
"branch": "main",
"revision": "e5875f32d37d0de760bd4ca3b988f42373866f96",
"version": null
}
},
{
"package": "SwiftSyntax",
"repositoryURL": "https://github.com/apple/swift-syntax.git",
"state": {
"branch": "main",
"revision": "1e61cc3bd13c0f61d75e509994e00e64fecf8bf3",
"version": null
}
},
{
"package": "swift-system",
"repositoryURL": "https://github.com/apple/swift-system.git",
"state": {
"branch": null,
"revision": "836bc4557b74fe6d2660218d56e3ce96aff76574",
"version": "1.1.1"
}
},
{
"package": "swift-tools-support-core",
"repositoryURL": "https://github.com/apple/swift-tools-support-core.git",
"state": {
"branch": null,
"revision": "284a41800b7c5565512ec6ae21ee818aac1f84ac",
"version": "0.4.0"
}
"pins" : [
{
"identity" : "hpnetwork",
"kind" : "remoteSourceControl",
"location" : "https://github.com/henrik-dmg/HPNetwork",
"state" : {
"revision" : "a4629039573f695f97fc044032c4e654b40671b0",
"version" : "4.0.1"
}
]
},
"version": 1
},
{
"identity" : "hpurlbuilder",
"kind" : "remoteSourceControl",
"location" : "https://github.com/henrik-dmg/HPURLBuilder",
"state" : {
"revision" : "49ad1fb6f10914e7134dc9f8e5c21f48a52e3d37",
"version" : "1.1.0"
}
},
{
"identity" : "swift-http-types",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-http-types.git",
"state" : {
"revision" : "ae67c8178eb46944fd85e4dc6dd970e1f3ed6ccd",
"version" : "1.3.0"
}
}
],
"version" : 2
}
Loading

0 comments on commit 8d1fd56

Please sign in to comment.