Skip to content

Commit

Permalink
Setup building and releasing with Github Actions (#3)
Browse files Browse the repository at this point in the history
With Github Actions each language is build and tested independently from the
others. This significantly releases the complexity of the build environment
needed.

Additionally, for the same reason, code generation is no longer included in
the build process. Rather all generated files are checked in. Two seperate make
command exists to copy gherkin-languages.json and generate parsers using Berp.
  • Loading branch information
mpkorstanje authored Nov 8, 2022
1 parent c35db4a commit 1cc2ef0
Show file tree
Hide file tree
Showing 175 changed files with 4,546 additions and 14,312 deletions.
18 changes: 18 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"extends": [
"config:base",
":preserveSemverRanges",
":rebaseStalePrs",
":disableDependencyDashboard"
],
"labels": [":robot: dependencies"],
"prHourlyLimit": 0,
"packageRules": [
{
"depTypeList": ["devDependencies", "dependencies"],
"updateTypes": ["minor", "patch"],
"automerge": true,
"automergeType": "branch"
}
]
}
20 changes: 20 additions & 0 deletions .github/workflows/release-cpan.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Release Perl/CPAN

on:
push:
branches: [release/*]

jobs:
create-perl-release:
name: Publish to CPAN
runs-on: ubuntu-latest
environment: Release
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: cucumber/[email protected]
with:
cpan-user: ${{ secrets.CPAN_USER }}
cpan-password: ${{ secrets.CPAN_PASSWORD }}
working-directory: 'perl'
18 changes: 18 additions & 0 deletions .github/workflows/release-github.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Release GitHub

on:
push:
branches: [release/*]

jobs:
create-github-release:
name: Create GitHub Release and Git tag
runs-on: ubuntu-latest
environment: Release
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: cucumber/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
27 changes: 27 additions & 0 deletions .github/workflows/release-go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Release Go

on:
push:
branches: [release/*]

jobs:
read-version:
name: Read version to release
runs-on: ubuntu-latest
outputs:
version: ${{ steps.versions.outputs.changelog-latest-version }}
steps:
- uses: actions/checkout@v3
- uses: cucumber/[email protected]
id: versions

publish-go:
name: Create go/v* tag
runs-on: ubuntu-latest
needs: read-version
steps:
- uses: actions/checkout@v3
- name: Create git tag
run: |
git tag "go/v${{ needs.read-version.outputs.version }}"
git push --tags
28 changes: 28 additions & 0 deletions .github/workflows/release-hex.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Release Elixir hex package

on:
push:
branches: [release/*]

jobs:
create-hex-release:
name: Publish to hex.pm
runs-on: ubuntu-latest
environment: Release
permissions:
contents: write
steps:
- uses: actions/checkout@v3

- uses: erlef/setup-beam@v1
with:
otp-version: '22.2'
elixir-version: '1.10.x'

- name: Install Protoc
uses: arduino/setup-protoc@v1

- uses: cucumber/[email protected]
with:
hex-api-key: ${{ secrets.HEX_API_KEY }}
working-directory: 'elixir'
25 changes: 25 additions & 0 deletions .github/workflows/release-mvn.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Release Maven

on:
push:
branches: [release/*]

jobs:
publish-mvn:
name: Publish Maven Package
runs-on: ubuntu-latest
environment: Release
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
cache: 'maven'
- uses: cucumber/[email protected]
with:
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }}
nexus-username: cukebot
nexus-password: ${{ secrets.SONATYPE_PASSWORD }}
working-directory: java
24 changes: 24 additions & 0 deletions .github/workflows/release-npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Release NPM

on:
push:
branches: [release/*]

jobs:
publish-npm:
name: Publish NPM module
runs-on: ubuntu-latest
environment: Release
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'npm'
cache-dependency-path: javascript/package-lock.json
- run: npm install-test
working-directory: javascript
- uses: cucumber/[email protected]
with:
npm-token: ${{ secrets.NPM_TOKEN }}
working-directory: javascript
22 changes: 22 additions & 0 deletions .github/workflows/release-nuget.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Release NuGet

on:
push:
branches:
- "release/*"

jobs:
publish-nuget:
name: Publish package to NuGet.org
runs-on: ubuntu-latest
environment: Release
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- uses: cucumber/[email protected]
with:
nuget-api-key: ${{ secrets.NUGET_API_KEY }}
working-directory: "dotnet"
21 changes: 21 additions & 0 deletions .github/workflows/release-php.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Release PHP

on:
push:
branches: [release/*]

jobs:
create-php-release:
name: Publish to PHP subrepo
runs-on: ubuntu-latest
environment: Release
permissions:
contents: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: '0'
- uses: cucumber/[email protected]
with:
working-directory: php
github-token: ${{ secrets.CUKEBOT_GITHUB_TOKEN }}
21 changes: 21 additions & 0 deletions .github/workflows/release-rubygem.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Release RubyGems

on:
push:
branches: [release/*]

jobs:
publish-rubygem:
name: Publish Ruby Gem
runs-on: ubuntu-latest
environment: Release
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0.2'
bundler-cache: true
- uses: cucumber/[email protected]
with:
rubygems_api_key: ${{ secrets.RUBYGEMS_API_KEY }}
working_directory: ruby
22 changes: 22 additions & 0 deletions .github/workflows/test-c.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: test-c

on:
push:
branches:
- main
- renovate/**
pull_request:
branches:
- main
workflow_call:

jobs:
test-c:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: run make
run: make
working-directory: c
41 changes: 41 additions & 0 deletions .github/workflows/test-codegen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: test-codegen

on:
push:
branches:
- main
- renovate/**
pull_request:
branches:
- main
workflow_call:

jobs:
test-codegen:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- uses: actions/setup-dotnet@v3
with:
dotnet-version: '5.0.x'

- name: install berp
run: |
dotnet tool update Berp --version 1.3.0 --tool-path ~/bin
echo "~/bin" >> $GITHUB_PATH
- name: generate code for all languages
run: |
make clean-gherkin-languages
make copy-gherkin-languages
make clean-generate
make generate
- name: check the repo is still clean after generation
run: |
git status --porcelain
git diff HEAD
[ -z "$(git status --porcelain)" ]
25 changes: 25 additions & 0 deletions .github/workflows/test-dart.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: test-dart

on:
push:
branches:
- main
- renovate/**
pull_request:
branches:
- main
workflow_call:

jobs:
test-dart:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: install dart
uses: dart-lang/[email protected]

- name: run tests
run: dart test
working-directory: dart
28 changes: 28 additions & 0 deletions .github/workflows/test-dotnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: test-dotnet

on:
push:
branches:
- main
- renovate/**
pull_request:
branches:
- main
workflow_call:

jobs:
test-dotnet:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '5.0.x'

- run: dotnet test
working-directory: dotnet

- name: run acceptance tests
run: make acceptance
working-directory: dotnet
37 changes: 37 additions & 0 deletions .github/workflows/test-elixir.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: test-elixir

on:
push:
branches:
- main
- renovate/**
pull_request:
branches:
- main
workflow_call:

jobs:
test-elixir:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: erlef/setup-beam@v1
with:
otp-version: '22.2'
elixir-version: '1.10.x'

- name: Install Protoc
uses: arduino/setup-protoc@v1

- run: |
mix local.hex --force
mix deps.get
working-directory: elixir
- run: mix test
working-directory: elixir

- name: run acceptance tests
run: make acceptance
working-directory: elixir
Loading

0 comments on commit 1cc2ef0

Please sign in to comment.