Skip to content

Commit 3679c43

Browse files
authored
chore: Enable CI and Publishing workflows (#3)
1 parent 7511fe9 commit 3679c43

22 files changed

+1367
-1
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is this a support request?**
11+
This issue tracker is maintained by LaunchDarkly SDK developers and is intended for feedback on the SDK code. If you're not sure whether the problem you are having is specifically related to the SDK, or to the LaunchDarkly service overall, it may be more appropriate to contact the LaunchDarkly support team; they can help to investigate the problem and will consult the SDK team if necessary. You can submit a support request by going [here](https://support.launchdarkly.com/hc/en-us/requests/new) or by emailing [email protected].
12+
13+
Note that issues filed on this issue tracker are publicly accessible. Do not provide any private account information on your issues. If your problem is specific to your account, you should submit a support request as described above.
14+
15+
**Describe the bug**
16+
A clear and concise description of what the bug is.
17+
18+
**To reproduce**
19+
Steps to reproduce the behavior.
20+
21+
**Expected behavior**
22+
A clear and concise description of what you expected to happen.
23+
24+
**Logs**
25+
If applicable, add any log output related to your problem.
26+
27+
**SDK version**
28+
The version of this SDK that you are using.
29+
30+
**Language version, developer tools**
31+
For instance, Go 1.11 or Ruby 2.5.3. If you are using a language that requires a separate compiler, such as C, please include the name and version of the compiler too.
32+
33+
**OS/platform**
34+
For instance, Ubuntu 16.04, Windows 10, or Android 4.0.3. If your code is running in a browser, please also include the browser type and version.
35+
36+
**Additional context**
37+
Add any other context about the problem here.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Support request
4+
url: https://support.launchdarkly.com/hc/en-us/requests/new
5+
about: File your support requests with LaunchDarkly's support team
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I would love to see the SDK [...does something new...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context about the feature request here.

.github/actions/build-docs/action.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: Build Documentation
2+
description: 'Build Documentation.'
3+
4+
runs:
5+
using: composite
6+
steps:
7+
- name: Build Documentation
8+
shell: bash
9+
run: cd docs && make html

.github/actions/ci/action.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: CI Workflow
2+
description: 'Shared CI workflow.'
3+
inputs:
4+
ruby-version:
5+
description: 'The version of ruby to setup and run'
6+
required: true
7+
8+
runs:
9+
using: composite
10+
steps:
11+
- uses: ruby/setup-ruby@v1
12+
with:
13+
ruby-version: ${{ inputs.ruby-version }}
14+
15+
- name: Install dependencies
16+
shell: bash
17+
run: bundle install
18+
19+
- name: Run tests
20+
shell: bash
21+
run: bundle exec rspec spec
22+
23+
- name: Run RuboCop
24+
shell: bash
25+
run: bundle exec rubocop --parallel
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Publish Documentation
2+
description: 'Publish the documentation to GitHub Pages'
3+
inputs:
4+
token:
5+
description: 'Token to use for publishing.'
6+
required: true
7+
8+
runs:
9+
using: composite
10+
steps:
11+
- uses: launchdarkly/gh-actions/actions/[email protected]
12+
name: 'Publish to Github pages'
13+
with:
14+
docs_path: docs/build/html/
15+
github_token: ${{inputs.token}} # For the shared action the token should be a GITHUB_TOKEN<

.github/actions/publish/action.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Publish Package
2+
description: 'Publish the package to rubygems'
3+
inputs:
4+
dry_run:
5+
description: 'Is this a dry run. If so no package will be published.'
6+
required: true
7+
outputs:
8+
gem-hash:
9+
description: "base64-encoded sha256 hashes of distribution files"
10+
value: ${{ steps.gem-hash.outputs.gem-hash }}
11+
12+
runs:
13+
using: composite
14+
steps:
15+
- name: Build gemspec
16+
shell: bash
17+
run: gem build launchdarkly-server-sdk-ai.gemspec
18+
19+
- name: Hash gem for provenance
20+
id: gem-hash
21+
shell: bash
22+
run: |
23+
echo "gem-hash=$(sha256sum launchdarkly-server-sdk-ai-*.gem | base64 -w0)" >> "$GITHUB_OUTPUT"
24+
25+
- name: Publish Library
26+
shell: bash
27+
if: ${{ inputs.dry_run == 'false' }}
28+
run: gem push launchdarkly-server-sdk-ai-*.gem

.github/pull_request_template.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
**Requirements**
2+
3+
- [ ] I have added test coverage for new or changed functionality
4+
- [ ] I have followed the repository's [pull request submission guidelines](../blob/main/CONTRIBUTING.md#submitting-pull-requests)
5+
- [ ] I have validated my changes against all supported platform versions
6+
7+
**Related issues**
8+
9+
Provide links to any issues in this repository or elsewhere relating to this pull request.
10+
11+
**Describe the solution you've provided**
12+
13+
Provide a clear and concise description of what you expect to happen.
14+
15+
**Describe alternatives you've considered**
16+
17+
Provide a clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
21+
Add any other context about the pull request here.

.github/workflows/ci.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Run CI
2+
on:
3+
push:
4+
branches: [ main, 'feat/**' ]
5+
paths-ignore:
6+
- '**.md' # Do not need to run CI for markdown changes.
7+
pull_request:
8+
branches: [ main, 'feat/**' ]
9+
paths-ignore:
10+
- '**.md'
11+
12+
jobs:
13+
build-linux:
14+
runs-on: ubuntu-latest
15+
16+
strategy:
17+
matrix:
18+
ruby-version:
19+
- '3.0'
20+
- '3.1'
21+
- '3.2'
22+
- jruby-9.4
23+
24+
steps:
25+
- uses: actions/checkout@v4
26+
with:
27+
fetch-depth: 0 # If you only need the current version keep this.
28+
29+
- uses: ./.github/actions/ci
30+
with:
31+
ruby-version: ${{ matrix.ruby-version }}
32+
33+
- uses: ./.github/actions/build-docs
34+
if: ${{ !startsWith(matrix.ruby-version, 'jruby') }}
35+
36+
build-windows:
37+
runs-on: windows-latest
38+
39+
defaults:
40+
run:
41+
shell: powershell
42+
43+
steps:
44+
- uses: actions/checkout@v4
45+
46+
- uses: ruby/setup-ruby@v1
47+
with:
48+
ruby-version: 3.0
49+
50+
- name: Install dependencies
51+
run: bundle install
52+
53+
- name: Run tests
54+
run: bundle exec rspec spec

.github/workflows/lint-pr-title.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Lint PR title
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
10+
jobs:
11+
lint-pr-title:
12+
uses: launchdarkly/gh-actions/.github/workflows/lint-pr-title.yml@main

0 commit comments

Comments
 (0)