-
Notifications
You must be signed in to change notification settings - Fork 42
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 (#187)
- Loading branch information
Showing
14 changed files
with
282 additions
and
146 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,21 @@ | ||
# Use a step like this to build documentation. | ||
name: Build Documentation | ||
description: 'Build Documentation.' | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Build Documentation | ||
shell: bash | ||
run: | | ||
phpdoc \ | ||
-d src \ | ||
-t "docs" \ | ||
--ignore Impl/ \ | ||
--ignore '*/Impl/' \ | ||
--ignore-tags psalm-param \ | ||
--ignore-tags psalm-var \ | ||
--ignore-tags psalm-return \ | ||
--visibility public \ | ||
--defaultpackagename "LaunchDarkly" \ | ||
--title "LaunchDarkly PHP SDK" |
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,48 @@ | ||
name: CI Workflow | ||
description: 'Shared CI workflow.' | ||
inputs: | ||
php-version: | ||
description: 'Which version of PHP should we setup?' | ||
required: false | ||
default: 8.0 | ||
use-lowest-dependencies: | ||
description: 'Should we prefer the lowest dependency version?' | ||
type: boolean | ||
required: false | ||
default: false | ||
token: | ||
description: 'Token used to prevent composer rate limiting' | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@e6f75134d35752277f093989e72e140eaa222f35 | ||
with: | ||
php-version: ${{ inputs.php-version }} | ||
extensions: xdebug | ||
tools: phpdoc:3.1.2 | ||
env: | ||
GITHUB_TOKEN: ${{ inputs.token }} | ||
|
||
- name: Install dependencies | ||
shell: bash | ||
run: composer install --no-progress | ||
|
||
- name: Downgrade to lowest versions | ||
if: ${{ inputs.use-lowest-dependencies }} | ||
shell: bash | ||
run: composer update --prefer-lowest --prefer-stable | ||
|
||
- name: Run unit tests | ||
shell: bash | ||
run: make test | ||
|
||
- name: Run lint checks | ||
shell: bash | ||
run: make lint | ||
|
||
- name: Run contract tests | ||
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/publish-pages@publish-pages-v1.0.1 | ||
name: 'Publish to Github pages' | ||
with: | ||
docs_path: docs | ||
github_token: ${{ inputs.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,83 @@ | ||
name: Run CI | ||
on: | ||
push: | ||
branches: [ 5.x ] | ||
paths-ignore: | ||
- '**.md' # Do not need to run CI for markdown changes. | ||
pull_request: | ||
branches: [ 5.x ] | ||
paths-ignore: | ||
- '**.md' | ||
|
||
jobs: | ||
linux-build: | ||
runs-on: ubuntu-latest | ||
|
||
services: | ||
wiremock: | ||
image: wiremock/wiremock | ||
ports: | ||
- 8080:8080 | ||
|
||
strategy: | ||
matrix: | ||
php-version: [8.0, 8.1] | ||
use-lowest-dependencies: [true, false] | ||
|
||
env: | ||
LD_INCLUDE_INTEGRATION_TESTS: 1 | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # If you only need the current version keep this. | ||
|
||
- uses: ./.github/actions/ci | ||
with: | ||
php-version: ${{ matrix.php-version }} | ||
use-lowest-dependencies: ${{ matrix.use-lowest-dependencies }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
windows-build: | ||
runs-on: windows-latest | ||
|
||
strategy: | ||
matrix: | ||
php-version: [8.0.30, 8.1.26] | ||
|
||
env: | ||
LD_INCLUDE_INTEGRATION_TESTS: 1 | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # If you only need the current version keep this. | ||
|
||
- name: Install java support | ||
run: choco install -y javaruntime | ||
|
||
- name: Install php support | ||
run: choco install -y php --version=${{ matrix.php-version }} --force | ||
|
||
- name: Install composer | ||
run: choco install -y composer | ||
|
||
- name: Download wiremock | ||
run: Invoke-WebRequest -Uri https://repo1.maven.org/maven2/com/github/tomakehurst/wiremock-jre8-standalone/2.31.0/wiremock-jre8-standalone-2.31.0.jar -UseBasicParsing -OutFile wiremock.jar | ||
|
||
- name: Verify checksum | ||
shell: bash | ||
run: | | ||
[ "$(sha256sum wiremock.jar | awk '{ print $1 }')" == "c5cd526e04c57293ec847d845733b017c4052d2132653332e05a54272934a305" ] | ||
- name: Start wiremock | ||
run: cmd /c "START /b java -jar ./wiremock.jar" | ||
|
||
- name: Wait for wiremock to be available | ||
run: PowerShell -Command Start-Sleep -Seconds 5 | ||
|
||
- name: Install dependencies | ||
run: composer install --no-progress | ||
|
||
- name: Run tests | ||
run: .\vendor\bin\phpunit |
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,35 @@ | ||
on: | ||
workflow_dispatch: | ||
|
||
name: Publish Documentation | ||
jobs: | ||
build-publish: | ||
runs-on: ubuntu-latest | ||
|
||
services: | ||
wiremock: | ||
image: wiremock/wiremock | ||
ports: | ||
- 8080:8080 | ||
|
||
env: | ||
LD_INCLUDE_INTEGRATION_TESTS: 1 | ||
|
||
permissions: | ||
contents: write # Needed in this case to write github pages. | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Build and Test | ||
uses: ./.github/actions/ci | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build documentation | ||
uses: ./.github/actions/build-docs | ||
|
||
- name: Publish Documentation | ||
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,51 @@ | ||
name: Run Release Please | ||
|
||
on: | ||
push: | ||
branches: | ||
- 5.x | ||
|
||
jobs: | ||
release-package: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: write # Contents and pull-requests are for release-please to make releases. | ||
pull-requests: write | ||
|
||
services: | ||
wiremock: | ||
image: wiremock/wiremock | ||
ports: | ||
- 8080:8080 | ||
|
||
env: | ||
LD_INCLUDE_INTEGRATION_TESTS: 1 | ||
|
||
steps: | ||
- uses: google-github-actions/release-please-action@v3 | ||
id: release | ||
with: | ||
command: manifest | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
default-branch: 5.x | ||
|
||
- uses: actions/checkout@v4 | ||
if: ${{ steps.release.outputs.releases_created }} | ||
with: | ||
fetch-depth: 0 # If you only need the current version keep this. | ||
|
||
- name: Build and Test | ||
if: ${{ steps.release.outputs.releases_created }} | ||
uses: ./.github/actions/ci | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build documentation | ||
if: ${{ steps.release.outputs.releases_created }} | ||
uses: ./.github/actions/build-docs | ||
|
||
- uses: ./.github/actions/publish-docs | ||
if: ${{ steps.release.outputs.releases_created }} | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} |
Oops, something went wrong.