-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SWI-1694: Update test and deployment workflows #76
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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 |
---|---|---|
@@ -1,46 +1,125 @@ | ||
name: Deploy | ||
name: Deploy SDK | ||
|
||
on: | ||
release: | ||
types: | ||
- published | ||
|
||
env: | ||
BW_ACCOUNT_ID: ${{ secrets.BW_ACCOUNT_ID }} | ||
BW_USERNAME: ${{ secrets.BW_USERNAME }} | ||
BW_PASSWORD: ${{ secrets.BW_PASSWORD }} | ||
BW_USERNAME_FORBIDDEN: ${{ secrets.BW_USERNAME_FORBIDDEN}} | ||
BW_PASSWORD_FORBIDDEN: ${{ secrets.BW_PASSWORD_FORBIDDEN}} | ||
BW_VOICE_APPLICATION_ID: ${{ secrets.BW_VOICE_APPLICATION_ID }} | ||
BW_MESSAGING_APPLICATION_ID: ${{ secrets.BW_MESSAGING_APPLICATION_ID }} | ||
BW_NUMBER: ${{ secrets.BW_NUMBER }} | ||
USER_NUMBER: ${{ secrets.USER_NUMBER }} | ||
BASE_CALLBACK_URL: ${{ secrets.BASE_CALLBACK_URL }} | ||
MANTECA_ACTIVE_NUMBER: ${{ secrets.MANTECA_ACTIVE_NUMBER }} | ||
MANTECA_APPLICATION_ID: ${{ secrets.MANTECA_APPLICATION_ID }} | ||
MANTECA_BASE_URL: ${{ secrets.MANTECA_BASE_URL }} | ||
MANTECA_IDLE_NUMBER: ${{ secrets.MANTECA_IDLE_NUMBER }} | ||
OPERATING_SYSTEM: ubuntu-latest | ||
CSHARP_VERSION: 7.0.x | ||
|
||
jobs: | ||
publish: | ||
name: Publish | ||
if: ${{ !github.event.release.prerelease && github.event.release.target_commitish == 'main' }} | ||
env: | ||
BW_PROJECT_NAME: Bandwidth.Standard | ||
BW_PROJECT_TEST_NAME: Bandwidth.StandardTests | ||
deploy_pre_release: | ||
name: Deploy OpenAPI Generator Client Pre-Release | ||
if: ${{ !github.event.release.prerelease && github.event.release.target_commitish == 'feature/openapi-generator-sdk' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
env: | ||
BW_PROJECT_NAME: src/Bandwidth.Standard | ||
BW_PROJECT_TEST_NAME: src/Bandwidth.Standard.Test | ||
steps: | ||
- name: Set release version | ||
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV | ||
- uses: actions/setup-dotnet@v1 | ||
|
||
- name: Check Release Tag Format | ||
run: | | ||
re=[0-9]+\.[0-9]+\.[0-9]+b[0-9]+ | ||
if ! [[ $RELEASE_VERSION =~ $re ]]; then | ||
echo 'Tag does not match expected regex pattern for beta releases (v[0-9]+.[0-9]+.[0-9]+b[0-9]+)' | ||
echo $RELEASE_VERSION | ||
echo 'Please update your tag to match the expected regex pattern' | ||
exit 1 | ||
fi | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: feature/openapi-generator-sdk | ||
|
||
- name: Setup Dotnet | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: '7.0.x' | ||
|
||
- name: Run integration tests | ||
run: dotnet test $BW_PROJECT_TEST_NAME | ||
|
||
- name: Pack NuGet package | ||
run: dotnet pack --configuration Release $BW_PROJECT_NAME -p:PackageVersion=$RELEASE_VERSION | ||
|
||
- name: Publish NuGet package | ||
env: | ||
BW_ACCOUNT_ID: ${{ secrets.BW_ACCOUNT_ID }} | ||
BW_USERNAME: ${{ secrets.BW_USERNAME }} | ||
BW_PASSWORD: ${{ secrets.BW_PASSWORD }} | ||
BW_USERNAME_FORBIDDEN: ${{ secrets.BW_USERNAME_FORBIDDEN}} | ||
BW_PASSWORD_FORBIDDEN: ${{ secrets.BW_PASSWORD_FORBIDDEN}} | ||
BW_VOICE_APPLICATION_ID: ${{ secrets.BW_VOICE_APPLICATION_ID }} | ||
BW_MESSAGING_APPLICATION_ID: ${{ secrets.BW_MESSAGING_APPLICATION_ID }} | ||
BW_NUMBER: ${{ secrets.BW_NUMBER }} | ||
USER_NUMBER: ${{ secrets.USER_NUMBER }} | ||
BASE_CALLBACK_URL: ${{ secrets.BASE_CALLBACK_URL }} | ||
MANTECA_ACTIVE_NUMBER: ${{ secrets.MANTECA_ACTIVE_NUMBER }} | ||
MANTECA_APPLICATION_ID: ${{ secrets.MANTECA_APPLICATION_ID }} | ||
MANTECA_BASE_URL: ${{ secrets.MANTECA_BASE_URL }} | ||
MANTECA_IDLE_NUMBER: ${{ secrets.MANTECA_IDLE_NUMBER }} | ||
OPERATING_SYSTEM: ${{ matrix.os }} | ||
CSHARP_VERSION: ${{ matrix.dotnet }} | ||
NUGET_KEY: ${{ secrets.NUGET_KEY }} | ||
NUGET_SOURCE: https://api.nuget.org/v3/index.json | ||
run: dotnet nuget push $BW_PROJECT_NAME/bin/Release/*.nupkg -s $NUGET_SOURCE -k $NUGET_KEY | ||
|
||
- name: Notify Slack of build status | ||
uses: Bandwidth/[email protected] | ||
if: always() | ||
with: | ||
job-status: ${{ job.status }} | ||
slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }} | ||
slack-channel: ${{ secrets.SLACK_CHANNEL }} | ||
|
||
deploy: | ||
name: deploy 'main' branch | ||
if: ${{ !github.event.release.prerelease && github.event.release.target_commitish == 'main' }} | ||
runs-on: ubuntu-latest | ||
env: | ||
BW_PROJECT_NAME: src/Bandwidth.Standard | ||
BW_PROJECT_TEST_NAME: src/Bandwidth.Standard.Test | ||
steps: | ||
- name: Set release version | ||
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV | ||
|
||
- name: Check Release Tag Format | ||
run: | | ||
re=[0-9]+\.[0-9]+\.[0-9]+[0-9]+ | ||
if ! [[ $RELEASE_VERSION =~ $re ]]; then | ||
echo 'Tag does not match expected regex pattern for beta releases (v[0-9]+.[0-9]+.[0-9]+[0-9]+)' | ||
echo $RELEASE_VERSION | ||
echo 'Please update your tag to match the expected regex pattern' | ||
exit 1 | ||
fi | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Dotnet | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: '7.0.x' | ||
|
||
- name: Run integration tests | ||
run: dotnet test $BW_PROJECT_TEST_NAME | ||
|
||
- name: Pack NuGet package | ||
run: dotnet pack --configuration Release $BW_PROJECT_NAME -p:PackageVersion=$RELEASE_VERSION | ||
|
||
- name: Publish NuGet package | ||
env: | ||
NUGET_KEY: ${{ secrets.NUGET_KEY }} | ||
NUGET_SOURCE: https://api.nuget.org/v3/index.json | ||
run: dotnet nuget push $BW_PROJECT_NAME/bin/Release/*.nupkg -s $NUGET_SOURCE -k $NUGET_KEY | ||
|
||
- name: Notify Slack of build status | ||
uses: Bandwidth/[email protected] | ||
if: always() | ||
with: | ||
job-status: ${{ job.status }} | ||
slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }} | ||
slack-channel: ${{ secrets.SLACK_CHANNEL }} |
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,86 @@ | ||
name: Test Main Branch Nightly | ||
on: | ||
schedule: | ||
- cron: "0 4 * * *" | ||
|
||
env: | ||
BW_ACCOUNT_ID: ${{ secrets.BW_ACCOUNT_ID }} | ||
BW_USERNAME: ${{ secrets.BW_USERNAME }} | ||
BW_PASSWORD: ${{ secrets.BW_PASSWORD }} | ||
BW_USERNAME_FORBIDDEN: ${{ secrets.BW_USERNAME_FORBIDDEN}} | ||
BW_PASSWORD_FORBIDDEN: ${{ secrets.BW_PASSWORD_FORBIDDEN}} | ||
BW_VOICE_APPLICATION_ID: ${{ secrets.BW_VOICE_APPLICATION_ID }} | ||
BW_MESSAGING_APPLICATION_ID: ${{ secrets.BW_MESSAGING_APPLICATION_ID }} | ||
BW_NUMBER: ${{ secrets.BW_NUMBER }} | ||
USER_NUMBER: ${{ secrets.USER_NUMBER }} | ||
BASE_CALLBACK_URL: ${{ secrets.BASE_CALLBACK_URL }} | ||
MANTECA_ACTIVE_NUMBER: ${{ secrets.MANTECA_ACTIVE_NUMBER }} | ||
MANTECA_APPLICATION_ID: ${{ secrets.MANTECA_APPLICATION_ID }} | ||
MANTECA_BASE_URL: ${{ secrets.MANTECA_BASE_URL }} | ||
MANTECA_IDLE_NUMBER: ${{ secrets.MANTECA_IDLE_NUMBER }} | ||
|
||
jobs: | ||
test_main: | ||
name: Test Main Branch Nightly | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [windows-2022, windows-2019, ubuntu-22.04, ubuntu-20.04] | ||
dotnet: [6.0.x, 7.0.x] | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: "main" | ||
|
||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: ${{ matrix.dotnet }} | ||
|
||
- name: Run functional tests | ||
env: | ||
OPERATING_SYSTEM: ${{ matrix.os }} | ||
CSHARP_VERSION: ${{ matrix.dotnet }} | ||
# Required for multiple target frameworks in the StandardTests project. | ||
DOTNET: ${{ matrix.dotnet }} | ||
run: dotnet test src/Bandwidth.Standard.Test | ||
|
||
test_feature: | ||
name: Test Feature Branch Nightly | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [windows-2022, windows-2019, ubuntu-22.04, ubuntu-20.04] | ||
dotnet: [6.0.x, 7.0.x] | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: "feature/openapi-generator-sdk" | ||
|
||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: ${{ matrix.dotnet }} | ||
|
||
- name: Run functional tests | ||
env: | ||
OPERATING_SYSTEM: ${{ matrix.os }} | ||
CSHARP_VERSION: ${{ matrix.dotnet }} | ||
# Required for multiple target frameworks in the StandardTests project. | ||
DOTNET: ${{ matrix.dotnet }} | ||
run: dotnet test src/Bandwidth.Standard.Test | ||
|
||
notify_for_failures: | ||
name: Notify for failures | ||
needs: [test_main, test_feature] | ||
if: failure() | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Notify Slack of failures | ||
uses: Bandwidth/[email protected] | ||
with: | ||
job-status: failure | ||
slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }} | ||
slack-channel: ${{ secrets.SLACK_CHANNEL }} |
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,45 @@ | ||
name: Test PR | ||
on: | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
env: | ||
BW_ACCOUNT_ID: ${{ secrets.BW_ACCOUNT_ID }} | ||
BW_USERNAME: ${{ secrets.BW_USERNAME }} | ||
BW_PASSWORD: ${{ secrets.BW_PASSWORD }} | ||
BW_USERNAME_FORBIDDEN: ${{ secrets.BW_USERNAME_FORBIDDEN}} | ||
BW_PASSWORD_FORBIDDEN: ${{ secrets.BW_PASSWORD_FORBIDDEN}} | ||
BW_VOICE_APPLICATION_ID: ${{ secrets.BW_VOICE_APPLICATION_ID }} | ||
BW_MESSAGING_APPLICATION_ID: ${{ secrets.BW_MESSAGING_APPLICATION_ID }} | ||
BW_NUMBER: ${{ secrets.BW_NUMBER }} | ||
USER_NUMBER: ${{ secrets.USER_NUMBER }} | ||
BASE_CALLBACK_URL: ${{ secrets.BASE_CALLBACK_URL }} | ||
MANTECA_ACTIVE_NUMBER: ${{ secrets.MANTECA_ACTIVE_NUMBER }} | ||
MANTECA_APPLICATION_ID: ${{ secrets.MANTECA_APPLICATION_ID }} | ||
MANTECA_BASE_URL: ${{ secrets.MANTECA_BASE_URL }} | ||
MANTECA_IDLE_NUMBER: ${{ secrets.MANTECA_IDLE_NUMBER }} | ||
|
||
jobs: | ||
test_pr: | ||
name: Test PR | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [windows-2022, windows-2019, ubuntu-22.04, ubuntu-20.04] | ||
dotnet: [6.0.x, 7.0.x] | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: ${{ matrix.dotnet }} | ||
|
||
- name: Run functional tests | ||
env: | ||
OPERATING_SYSTEM: ${{ matrix.os }} | ||
CSHARP_VERSION: ${{ matrix.dotnet }} | ||
# Required for multiple target frameworks in the StandardTests project. | ||
DOTNET: ${{ matrix.dotnet }} | ||
run: dotnet test src/Bandwidth.Standard.Test |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are these gonna be correct with the
src
in there?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was basing this off of the following step
dotnet test BW_PROJECT_TEST_NAME
fails ifBW_PROJECT_TEST_NAME=Bandwidth.Standard.Test
I figuredBW_PROJECT_NAME
would be the sameThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test-pr workflow passed and it has the following step
so we know that BW_PROJECT_TEST_NAME will work for sure