Skip to content

Commit 15f7679

Browse files
Add github workflows
1 parent 591c9f4 commit 15f7679

File tree

7 files changed

+226
-0
lines changed

7 files changed

+226
-0
lines changed

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"
7+
- package-ecosystem: "bundler"
8+
directory: "/"
9+
schedule:
10+
interval: "daily"
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name-template: 'guardrail-v$RESOLVED_VERSION'
2+
tag-template: 'guardrail-v$RESOLVED_VERSION'
3+
tag-prefix: guardrail-v
4+
include-paths:
5+
- "modules/codegen/src/main/"
6+
- "project/src/main/scala/Build.scala"
7+
- "project/src/main/scala/modules/guardrail.scala"
8+
# NB: Managed by support/regenerate-release-drafter.sh
9+
categories:
10+
- title: '🚀 Features'
11+
labels:
12+
- 'enhancement'
13+
- title: '🐛 Bug Fixes'
14+
labels:
15+
- 'bug'
16+
- title: '🧰 Maintenance'
17+
label: 'chore'
18+
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
19+
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
20+
version-resolver:
21+
major:
22+
labels:
23+
- 'major'
24+
minor:
25+
labels:
26+
- 'minor'
27+
patch:
28+
labels:
29+
- 'patch'
30+
default: patch
31+
template: |
32+
## Changes
33+
34+
$CHANGES
35+
36+
## Contributors
37+
38+
Thanks to $CONTRIBUTORS for your contributions to this release!
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
_extends: guardrail:.github/release-drafter.yml
2+
name-template: 'scala-pekko-http-v$RESOLVED_VERSION'
3+
tag-template: 'scala-pekko-http-v$RESOLVED_VERSION'
4+
tag-prefix: scala-pekko-http-v
5+
include-paths:
6+
- "modules/scala-pekko-http/src/main/"
7+
- "project/src/main/scala/modules/scalaPekkoHttp.scala"

.github/release-drafter.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
categories:
2+
- title: '🚀 Features'
3+
labels:
4+
- 'enhancement'
5+
- title: '🐛 Bug Fixes'
6+
labels:
7+
- 'bug'
8+
- title: '🧰 Maintenance'
9+
label: 'chore'
10+
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
11+
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
12+
version-resolver:
13+
major:
14+
labels:
15+
- 'major'
16+
minor:
17+
labels:
18+
- 'minor'
19+
patch:
20+
labels:
21+
- 'patch'
22+
default: patch
23+
template: |
24+
## Changes
25+
26+
$CHANGES
27+
28+
## Contributors
29+
30+
Thanks to $CONTRIBUTORS for your contributions to this release!

.github/workflows/ci.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
workflow_dispatch: {}
11+
12+
jobs:
13+
core:
14+
name: Reflect scala_versions
15+
runs-on: ubuntu-20.04
16+
strategy:
17+
matrix:
18+
java: [ '1.14' ]
19+
scala: [
20+
{ version: '2.12.18', bincompat: '2.12' }
21+
]
22+
outputs:
23+
scala_versions: ${{ steps.set-scala-versions.outputs.scala_versions }}
24+
steps:
25+
- uses: actions/checkout@v4
26+
with:
27+
fetch-depth: 0
28+
- uses: olafurpg/setup-scala@v14
29+
with:
30+
java-version: zulu@${{ matrix.java }}
31+
- name: Set scala version for matrix
32+
id: set-scala-versions # The greps on the following line are to ensure as much as possible that we've caught the right line
33+
run: echo "scala_versions=$(sbt 'print githubMatrixSettings' | grep '^\[{' | grep 'bincompat' | tail -n 1)" >> $GITHUB_OUTPUT
34+
scala:
35+
runs-on: ubuntu-20.04
36+
needs: [core]
37+
strategy:
38+
matrix:
39+
java: [ '1.14', '1.17' ]
40+
scala: ${{ fromJson(needs.core.outputs.scala_versions) }}
41+
framework: [
42+
{ framework: 'pekko-http', project: 'sample-pekkoHttp' },
43+
]
44+
steps:
45+
- run: echo 'combo_enabled=true' >> $GITHUB_ENV
46+
- run: echo 'combo_enabled=false' >> $GITHUB_ENV
47+
if: ${{ matrix.java == '1.17' && matrix.scala.bincompat == '2.12' }}
48+
- run: echo 'combo_enabled=false' >> $GITHUB_ENV
49+
if: matrix.scala.bincompat == '2.13' && matrix.framework.framework == 'dropwizard'
50+
- uses: actions/checkout@v4
51+
with:
52+
fetch-depth: 0
53+
- uses: olafurpg/setup-scala@v14
54+
with:
55+
java-version: zulu@${{ matrix.java }}
56+
- name: print Java version
57+
run: java -version
58+
- uses: actions/cache@v3
59+
with:
60+
path: ~/.cache/coursier
61+
key: ${{ runner.os }}-scala-${{ matrix.scala.version }}-${{ hashFiles('**/*.sbt') }}
62+
restore-keys: |
63+
${{ runner.os }}-scala-${{ matrix.scala.version }}-
64+
- name: Run tests
65+
if: ${{ env.combo_enabled == 'true' }}
66+
run: sbt ++${{ matrix.scala.version }} clean samples/clean coverage "runExample scala ${{ matrix.framework.framework }}" ${{ matrix.framework.project }}/test coverageAggregate
67+
- uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # 3.1.4
68+
if: ${{ env.combo_enabled == 'true' }}
69+
with:
70+
file: ./target/scala-${{ matrix.scala.bincompat }}/scoverage-report/scoverage.xml
71+
fail_ci_if_error: true
72+
token: ${{ secrets.CODECOV_TOKEN }}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Release Drafter
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
workflow_dispatch: {}
8+
9+
jobs:
10+
scala-pekko-http:
11+
name: '[scala-pekko-http] Draft release'
12+
runs-on: ubuntu-20.04
13+
steps:
14+
- uses: blast-hardcheese/[email protected]
15+
with:
16+
config-name: release-drafter-scala-pekko-http.yml
17+
env:
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types:
6+
- released
7+
workflow_dispatch:
8+
inputs:
9+
module:
10+
type: choice
11+
description: Which module to release
12+
options:
13+
- From Tag
14+
- scala-pekko-http
15+
16+
jobs:
17+
publish:
18+
name: 'Publish release'
19+
runs-on: ubuntu-20.04
20+
steps:
21+
- name: 'Extract project from tag'
22+
id: set-project-from-tag
23+
run: |
24+
module="${{ github.event.inputs.module }}"
25+
if [ -z "$module" ] || [ "$module" = "From Tag" ]; then
26+
module="$(echo "$GITHUB_REF" | sed 's~^refs/tags/\(.*\)-v[0-9.]\+$~\1~')"
27+
echo "extract project: ${GITHUB_REF}, ${module}"
28+
else
29+
echo "Using supplied module: $module"
30+
fi
31+
echo "module=$module" >> $GITHUB_OUTPUT
32+
- uses: actions/checkout@v4
33+
with:
34+
fetch-depth: 0
35+
- uses: actions/setup-java@v4
36+
with:
37+
distribution: zulu
38+
java-version: 14
39+
- name: 'Print versions'
40+
run: |
41+
java -version
42+
gpg --version
43+
- name: 'Publish artifacts [scala-pekko-http]'
44+
if: ${{ steps.set-project-from-tag.outputs.module == 'scala-pekko-http' }}
45+
run: sbt 'show version' "project guardrail-scala-pekko-http" clean compile versionCheck test ci-release
46+
env:
47+
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
48+
PGP_SECRET: ${{ secrets.PGP_SECRET }}
49+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
50+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
51+
GUARDRAIL_RELEASE_MODULE: ${{ steps.set-project-from-tag.outputs.module }}

0 commit comments

Comments
 (0)