-
Notifications
You must be signed in to change notification settings - Fork 20
Added csharp yml and integeration test github action #298
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
Changes from all commits
fc6d9b9
83ece76
ae186ce
4556794
d693e1e
94c5d16
0d67ae3
f76961e
8cb02fa
e06cfb2
07f74e7
6dbec21
f8aea69
9d0e2cd
ca4502c
5025f95
7b44224
643672c
eb4e0a3
a1e0134
7dfc08a
d724d69
070c85b
9f4ee81
e6af65e
7048a16
28d3964
4df8ab3
69a2758
531dff5
64c7b3c
0d7380c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
## Summary | ||
- The "what"; a concise description of each logical change | ||
- Another change | ||
|
||
The "why", or other context. | ||
|
||
## Test plan | ||
|
||
## Issues | ||
- "THING-1234" or "Fixes #123" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
|
||
name: Csharp CI with .NET | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
lint_markdown_files: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: '2.6' | ||
bundler-cache: true # runs 'bundle install' and caches installed gems automatically | ||
- name: Install gem | ||
run: | | ||
gem install awesome_bot | ||
- name: Run tests | ||
run: find . -type f -name '*.md' -exec awesome_bot {} \; | ||
|
||
integration_tests: | ||
uses: optimizely/csharp-sdk/.github/workflows/integration_test.yml@master | ||
secrets: | ||
CI_USER_TOKEN: ${{ secrets.CI_USER_TOKEN }} | ||
TRAVIS_COM_TOKEN: ${{ secrets.TRAVIS_COM_TOKEN }} | ||
|
||
fullstack_production_suite: | ||
uses: optimizely/csharp-sdk/.github/workflows/integration_test.yml@master | ||
with: | ||
FULLSTACK_TEST_REPO: ProdTesting | ||
secrets: | ||
CI_USER_TOKEN: ${{ secrets.CI_USER_TOKEN }} | ||
TRAVIS_COM_TOKEN: ${{ secrets.TRAVIS_COM_TOKEN }} | ||
|
||
unit_test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. checkout@v3? can we use the same version across all sdks. |
||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: 5.0.x | ||
- name: Restore nuget packages | ||
run: | | ||
nuget restore OptimizelySDK.Travis.sln | ||
nuget install ./OptimizelySDK.Tests/packages.config -OutputDirectory ./packages | ||
nuget install NUnit.Runners -Version 2.6.4 -OutputDirectory ./testrunner | ||
- name: script | ||
run: | | ||
./install_mono.sh | ||
xbuild /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=$(pwd)/keypair.snk /p:Configuration=Release ./OptimizelySDK.Travis.sln | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what's the result with msbuild? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what's the result with msbuild? |
||
mono ./testrunner/NUnit.Runners.2.6.4/tools/nunit-console.exe ./OptimizelySDK.Tests/bin/Release/OptimizelySDK.Tests.dll | ||
- name: find and sign dll | ||
run: | | ||
sudo find . -path './OptimizelySDK*bin/Release/OptimizelySDK*.dll' -not -regex '.*Tests.*' -print0 | while IFS= read -r -d '' file; do sn -R $file ./keypair.snk; done | ||
|
||
|
||
netStandard16: | ||
runs-on: windows-2022 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v2 | ||
with: | ||
dotnet-version: 3.1.x | ||
- name: Restore dependencies | ||
run: dotnet restore OptimizelySDK.NetStandard16/OptimizelySDK.NetStandard16.csproj | ||
- name: Build | ||
run: | | ||
# strongname signing is taken care of in build step | ||
dotnet build OptimizelySDK.NetStandard16/OptimizelySDK.NetStandard16.csproj /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=D:\a\csharp-sdk\csharp-sdk\keypair.snk -c Release | ||
# TODO: no dotnet test yet for NetStandard16 | ||
|
||
netStandard20: | ||
runs-on: windows-2022 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v2 | ||
with: | ||
dotnet-version: 3.1.x | ||
- name: Restore dependencies | ||
run: dotnet restore OptimizelySDK.NetStandard20/OptimizelySDK.NetStandard20.csproj | ||
- name: Build | ||
run: | | ||
# strongname signing is taken care of in build step | ||
dotnet build OptimizelySDK.NetStandard20/OptimizelySDK.NetStandard20.csproj /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=D:\a\csharp-sdk\csharp-sdk\keypair.snk -c Release | ||
# TODO: no dotnet test yet for NetStandard16 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Reusable action of running integration of production suite | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
FULLSTACK_TEST_REPO: | ||
required: false | ||
type: string | ||
secrets: | ||
CI_USER_TOKEN: | ||
required: true | ||
TRAVIS_COM_TOKEN: | ||
required: true | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
# You should create a personal access token and store it in your repository | ||
token: ${{ secrets.CI_USER_TOKEN }} | ||
repository: 'optimizely/travisci-tools' | ||
path: 'home/runner/travisci-tools' | ||
ref: 'master' | ||
- name: set SDK Branch if PR | ||
if: ${{ github.event_name == 'pull_request' }} | ||
run: | | ||
echo "SDK_BRANCH=${{ github.head_ref }}" >> $GITHUB_ENV | ||
echo "TRAVIS_BRANCH=${{ github.head_ref }}" >> $GITHUB_ENV | ||
- name: set SDK Branch if not pull request | ||
if: ${{ github.event_name != 'pull_request' }} | ||
run: | | ||
echo "SDK_BRANCH=${{ github.ref_name }}" >> $GITHUB_ENV | ||
echo "TRAVIS_BRANCH=${{ github.ref_name }}" >> $GITHUB_ENV | ||
- name: Trigger build | ||
env: | ||
SDK: csharp | ||
FULLSTACK_TEST_REPO: ${{ inputs.FULLSTACK_TEST_REPO }} | ||
BUILD_NUMBER: ${{ github.run_id }} | ||
TESTAPP_BRANCH: master | ||
GITHUB_TOKEN: ${{ secrets.CI_USER_TOKEN }} | ||
TRAVIS_EVENT_TYPE: ${{ github.event_name }} | ||
GITHUB_CONTEXT: ${{ toJson(github) }} | ||
TRAVIS_REPO_SLUG: ${{ github.repository }} | ||
TRAVIS_PULL_REQUEST_SLUG: ${{ github.repository }} | ||
UPSTREAM_REPO: ${{ github.repository }} | ||
TRAVIS_COMMIT: ${{ github.sha }} | ||
TRAVIS_PULL_REQUEST_SHA: ${{ github.event.pull_request.head.sha }} | ||
TRAVIS_PULL_REQUEST: ${{ github.event.pull_request.number }} | ||
UPSTREAM_SHA: ${{ github.sha }} | ||
TRAVIS_COM_TOKEN: ${{ secrets.TRAVIS_COM_TOKEN }} | ||
EVENT_MESSAGE: ${{ github.event.message }} | ||
HOME: 'home/runner' | ||
run: | | ||
echo "$GITHUB_CONTEXT" | ||
home/runner/travisci-tools/trigger-script-with-status-update.sh |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: Source clear | ||
|
||
on: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we put master only There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. GitHub Actions only runs scheduled jobs on the default branch of your repository (usually master or main) |
||
schedule: | ||
# Runs "weekly" | ||
- cron: '0 0 * * 0' | ||
|
||
jobs: | ||
source_clear: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Source clear scan | ||
env: | ||
SRCCLR_API_TOKEN: ${{ secrets.SRCCLR_API_TOKEN }} | ||
run: curl -sSL https://download.sourceclear.com/ci.sh | bash -s – scan |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
sudo apt install gnupg ca-certificates | ||
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF | ||
echo "deb https://download.mono-project.com/repo/ubuntu stable-bionic main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list | ||
sudo apt update | ||
sudo apt install mono-devel |
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.
checkout@v3? can we use the same version across all sdks.