-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Replace releaser with release please (#228)
- Loading branch information
Showing
16 changed files
with
292 additions
and
202 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
name: Build Documentation | ||
description: 'Build Documentation.' | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Build Documentation | ||
shell: bash | ||
run: cd docs && make html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: CI Workflow | ||
description: 'Shared CI workflow.' | ||
inputs: | ||
ruby-version: | ||
description: 'The version of ruby to setup and run' | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: ${{ inputs.ruby-version }} | ||
bundler: 2.2.33 | ||
|
||
- name: Install dependencies | ||
shell: bash | ||
run: bundle _2.2.33_ install | ||
|
||
- name: Skip flaky tests for jruby | ||
if: ${{ startsWith(inputs.ruby-version, 'jruby') }} | ||
shell: bash | ||
run: echo "SPEC_TAGS=-t '~flaky'" >> $GITHUB_ENV | ||
|
||
- name: Run tests | ||
shell: bash | ||
run: bundle _2.2.33_ exec rspec spec $SPEC_TAGS | ||
|
||
- name: Run RuboCop | ||
shell: bash | ||
run: bundle exec rubocop --parallel | ||
|
||
- name: Run contract tests | ||
if: ${{ !startsWith(inputs.ruby-version, 'jruby') }} | ||
shell: bash | ||
run: make contract-tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: Publish Documentation | ||
description: 'Publish the documentation to GitHub Pages' | ||
inputs: | ||
token: | ||
description: 'Token to use for publishing.' | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- uses: launchdarkly/gh-actions/actions/[email protected] | ||
name: 'Publish to Github pages' | ||
with: | ||
docs_path: docs/build/html/ | ||
github_token: ${{inputs.token}} # For the shared action the token should be a GITHUB_TOKEN< |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: Publish Package | ||
description: 'Publish the package to rubygems' | ||
inputs: | ||
dry_run: | ||
description: 'Is this a dry run. If so no package will be published.' | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Build gemspec | ||
shell: bash | ||
run: gem build ld-eventsource.gemspec | ||
|
||
- name: Publish Library | ||
shell: bash | ||
if: ${{ inputs.dry_run == 'false' }} | ||
run: gem push ld-eventsource-*.gem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
name: Run CI | ||
on: | ||
push: | ||
branches: [ 7.x ] | ||
paths-ignore: | ||
- '**.md' # Do not need to run CI for markdown changes. | ||
pull_request: | ||
branches: [ 7.x ] | ||
paths-ignore: | ||
- '**.md' | ||
|
||
jobs: | ||
build-linux: | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
LD_SKIP_DATABASE_TESTS: 0 | ||
|
||
strategy: | ||
matrix: | ||
ruby-version: | ||
- '2.7' | ||
- '3.0' | ||
- '3.1' | ||
- '3.2' | ||
- jruby-9.4 | ||
|
||
services: | ||
redis: | ||
image: redis | ||
ports: | ||
- 6379:6379 | ||
dynamodb: | ||
image: amazon/dynamodb-local | ||
ports: | ||
- 8000:8000 | ||
consul: | ||
image: hashicorp/consul | ||
ports: | ||
- 8500:8500 | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # If you only need the current version keep this. | ||
|
||
- uses: ./.github/actions/ci | ||
with: | ||
ruby-version: ${{ matrix.ruby-version }} | ||
|
||
- uses: ./.github/actions/build-docs | ||
if: ${{ !startsWith(matrix.ruby-version, 'jruby') }} | ||
|
||
build-windows: | ||
runs-on: windows-latest | ||
|
||
env: | ||
LD_SKIP_DATABASE_TESTS: 1 | ||
|
||
defaults: | ||
run: | ||
shell: powershell | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: 2.7 | ||
bundler: 2.2.33 | ||
|
||
- name: Install dependencies | ||
run: bundle _2.2.33_ install | ||
|
||
- name: Run tests | ||
run: bundle _2.2.33_ exec rspec spec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: Lint PR title | ||
|
||
on: | ||
pull_request_target: | ||
types: | ||
- opened | ||
- edited | ||
- synchronize | ||
|
||
jobs: | ||
lint-pr-title: | ||
uses: launchdarkly/gh-actions/.github/workflows/lint-pr-title.yml@main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
on: | ||
workflow_dispatch: | ||
|
||
name: Publish Documentation | ||
jobs: | ||
build-publish-docs: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write # Needed if using OIDC to get release secrets. | ||
contents: write # Needed in this case to write github pages. | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: 2.7 | ||
bundler: 2.2.33 | ||
|
||
- uses: ./.github/actions/build-docs | ||
|
||
- uses: ./.github/actions/publish-docs | ||
with: | ||
token: ${{secrets.GITHUB_TOKEN}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Publish Package | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
dry_run: | ||
description: 'Is this a dry run. If so no package will be published.' | ||
type: boolean | ||
required: true | ||
|
||
jobs: | ||
build-publish: | ||
runs-on: ubuntu-latest | ||
# Needed to get tokens during publishing. | ||
permissions: | ||
id-token: write | ||
contents: read | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: launchdarkly/gh-actions/actions/[email protected] | ||
name: 'Get rubygems API key' | ||
with: | ||
aws_assume_role: ${{ vars.AWS_ROLE_ARN }} | ||
ssm_parameter_pairs: '/production/common/releasing/rubygems/api_key = GEM_HOST_API_KEY' | ||
|
||
- id: build-and-test | ||
name: Build and Test | ||
uses: ./.github/actions/ci | ||
with: | ||
ruby-version: 2.7 | ||
|
||
- id: publish | ||
name: Publish Package | ||
uses: ./.github/actions/publish | ||
with: | ||
dry_run: ${{ inputs.dry_run }} |
Oops, something went wrong.