Skip to content

Commit

Permalink
add CI
Browse files Browse the repository at this point in the history
  • Loading branch information
patrick-zippenfenig committed Oct 16, 2023
1 parent 082a3d4 commit 26d0d16
Show file tree
Hide file tree
Showing 12 changed files with 8,166 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
version: 2
updates:
- package-ecosystem: pip
directory: "/"
schedule:
interval: daily
time: "13:00"
open-pull-requests-limit: 10
reviewers:
- dciborow
allow:
- dependency-type: direct
- dependency-type: indirect
commit-message:
prefix: "fix: "
- package-ecosystem: swift
directory: "/"
schedule:
interval: daily
time: "13:00"
open-pull-requests-limit: 10
reviewers:
- dciborow
allow:
- dependency-type: direct
- dependency-type: indirect
commit-message:
prefix: "fix: "
- package-ecosystem: npm
directory: "/"
schedule:
interval: daily
time: "13:00"
open-pull-requests-limit: 10
reviewers:
- dciborow
allow:
- dependency-type: direct
- dependency-type: indirect
commit-message:
prefix: "fix: "
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: daily
time: "13:00"
commit-message:
prefix: "fix: "
31 changes: 31 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Release

on:
push:
branches:
- main

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install semantic-release
run: npm install
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PYPI_TOKEN: ${{ secrets.PYPI_PASSWORD }}
run: npx semantic-release
17 changes: 17 additions & 0 deletions .github/workflows/semantic-pr-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: "Semantic PR Check"

on:
pull_request_target:
types:
- opened
- edited
- synchronize

jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42 changes: 42 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# see https://github.com/peripheryapp/periphery/blob/master/.github/workflows/test.yml

name: Test

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

env:
swift_package_resolve: swift package resolve
swift_test: swift test
cache_version: 2

jobs:
linux:
runs-on: ubuntu-22.04
container: swift:5.8.0-jammy
name: Linux
steps:
- name: Get Swift Version
id: get-swift-version
run: |
echo "::set-output name=version::$(swift -version | head -n 1 | sed s/,// )"
shell: bash
- uses: actions/checkout@v4
- name: Cache resolved dependencies
id: cache-resolved-dependencies
uses: actions/cache@v3
with:
path: |
.build
Package.resolved
key: ${{ runner.os }}-${{ steps.get-swift-version.outputs.version }}-${{ env.cache_version }}-spm-deps-${{ hashFiles('Package.swift', 'Package.resolved') }}
restore-keys: |
${{ runner.os }}-${{ steps.get-swift-version.outputs.version }}-${{ env.cache_version }}-spm-deps-
- name: Resolve dependencies
if: steps.cache-resolved-dependencies.outputs.cache-hit != 'true'
run: ${{ env.swift_package_resolve }}
- name: Test
run: ${{ env.swift_test }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ __pycache__/
# C extensions
*.so

.build/
.node_modules/
.swiftpm/

# Distribution / packaging
.Python
build/
Expand Down
46 changes: 46 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"branches": [
"main"
],
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"preset": "conventionalcommits",
"releaseRules": [
{
"type": "build",
"scope": "deps",
"release": "patch"
}
]
}
],
[
"@semantic-release/release-notes-generator",
{
"preset": "conventionalcommits",
"presetConfig": {
"types": [
{
"type": "feat",
"section": "Features"
},
{
"type": "fix",
"section": "Bug Fixes"
},
{
"type": "build",
"section": "Dependencies and Other Build Updates",
"hidden": false
}
]
}
}
],
"@semantic-release/git",
"@semantic-release/github",
"semantic-release-pypi"
]
}
14 changes: 14 additions & 0 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"pins" : [
{
"identity" : "flatbuffers",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/flatbuffers.git",
"state" : {
"revision" : "0100f6a5779831fa7a651e4b67ef389a8752bd9b",
"version" : "23.5.26"
}
}
],
"version" : 2
}
31 changes: 31 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// swift-tools-version: 5.6

import PackageDescription

let package = Package(
name: "OpenMeteoSdk",
platforms: [
.iOS(.v11),
.macOS(.v10_14),
],
products: [
.library(
name: "OpenMeteoSdk",
targets: ["OpenMeteoSdk"]),
],
dependencies: [
.package(url: "https://github.com/google/flatbuffers.git", from: "23.0.0")
],
targets: [
.target(
name: "OpenMeteoSdk",
dependencies: [
.product(name: "FlatBuffers", package: "flatbuffers")
],
path: "swift/Sources"),
.testTarget(
name: "OpenMeteoSdkTests",
dependencies: ["OpenMeteoSdk"],
path: "swift/Tests"),
]
)
Loading

0 comments on commit 26d0d16

Please sign in to comment.