-
Notifications
You must be signed in to change notification settings - Fork 28
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
Update CI scripts #104
Merged
Update CI scripts #104
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
03969a4
Update CI scripts
Shane32 9fee34f
Update
Shane32 dbc843b
Fix
Shane32 62b00cd
Updates
Shane32 1643d6a
Fix
Shane32 236cbe3
Update
Shane32 0ec5822
Update
Shane32 e709616
Fix test
Shane32 7c10c48
Update CI
Shane32 26714f4
update
Shane32 9057a63
Updates
Shane32 2a447d9
update
Shane32 c128435
Updates
Shane32 973382e
test
Shane32 7940a42
Undo
Shane32 03952cc
Update shouldly
Shane32 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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Build artifacts | ||
|
||
# ==== NOTE: do not rename this yml file or the run_number will be reset ==== | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- develop | ||
paths: | ||
- src/** | ||
- "*.sln" | ||
|
||
env: | ||
DOTNET_NOLOGO: true | ||
DOTNET_CLI_TELEMETRY_OPTOUT: true | ||
|
||
jobs: | ||
pack: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup .NET Core 5.0 SDK | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: '5.0.x' | ||
source-url: https://nuget.pkg.github.com/graphql-dotnet/index.json | ||
env: | ||
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
- name: Install dependencies | ||
run: dotnet restore | ||
- name: Build solution [Release] | ||
run: dotnet build --no-restore -c Release -p:VersionSuffix=$GITHUB_RUN_NUMBER | ||
- name: Pack solution [Release] | ||
run: dotnet pack --no-restore --no-build -c Release -p:VersionSuffix=$GITHUB_RUN_NUMBER -o out | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: Nuget packages | ||
path: | | ||
out/* | ||
- name: Publish Nuget packages to GitHub registry | ||
run: dotnet nuget push "out/*" -k ${{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,70 @@ | ||
name: Publish code | ||
|
||
on: | ||
release: | ||
types: | ||
- published | ||
|
||
env: | ||
DOTNET_NOLOGO: true | ||
DOTNET_CLI_TELEMETRY_OPTOUT: true | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Check github.ref starts with 'refs/tags/' | ||
if: ${{ !startsWith(github.ref, 'refs/tags/') }} | ||
run: | | ||
echo Error! github.ref does not start with 'refs/tags' | ||
echo github.ref: ${{ github.ref }} | ||
exit 1 | ||
- name: Set version number environment variable | ||
env: | ||
github_ref: ${{ github.ref }} | ||
run: | | ||
version="${github_ref:10}" | ||
echo version=$version | ||
echo "version=$version" >> $GITHUB_ENV | ||
- name: Setup .NET Core 5.0 SDK | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: '5.0.x' | ||
source-url: https://api.nuget.org/v3/index.json | ||
env: | ||
NUGET_AUTH_TOKEN: ${{secrets.NUGET_AUTH_TOKEN}} | ||
- name: Install dependencies | ||
run: dotnet restore | ||
- name: Build solution [Release] | ||
run: dotnet build --no-restore -c Release -p:Version=$version | ||
- name: Pack solution [Release] | ||
run: dotnet pack --no-restore --no-build -c Release -p:Version=$version -o out | ||
- name: Upload Nuget packages as workflow artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: Nuget packages | ||
path: | | ||
out/* | ||
- name: Publish Nuget packages to Nuget registry | ||
run: dotnet nuget push "out/*" -k ${{secrets.NUGET_AUTH_TOKEN}} | ||
- name: Upload Nuget packages as release artifacts | ||
uses: actions/github-script@v2 | ||
with: | ||
github-token: ${{secrets.GITHUB_TOKEN}} | ||
script: | | ||
console.log('environment', process.versions); | ||
const fs = require('fs').promises; | ||
const { repo: { owner, repo }, sha } = context; | ||
|
||
for (let file of await fs.readdir('src/out')) { | ||
console.log('uploading', file); | ||
|
||
await github.repos.uploadReleaseAsset({ | ||
owner, | ||
repo, | ||
release_id: ${{ github.event.release.id }}, | ||
name: file, | ||
data: await fs.readFile(`out/${file}`) | ||
}); | ||
} |
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,70 @@ | ||
name: Test code | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
- develop | ||
paths: | ||
- src/** | ||
- .github/workflows/** | ||
- "*.sln" | ||
# Upload code coverage results when PRs are merged | ||
push: | ||
branches: | ||
- master | ||
- develop | ||
paths: | ||
- src/** | ||
- .github/workflows/** | ||
|
||
env: | ||
DOTNET_NOLOGO: true | ||
DOTNET_CLI_TELEMETRY_OPTOUT: true | ||
|
||
jobs: | ||
test: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: | ||
- ubuntu-latest | ||
- windows-latest | ||
graphqlversion: | ||
- 4.0.2 | ||
- 4.1.0 | ||
- 4.2.0 | ||
- 4.3.0 | ||
- 4.4.0 | ||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v2 | ||
- name: Setup .NET Core 5.0 SDK | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: '5.0.x' | ||
source-url: https://nuget.pkg.github.com/graphql-dotnet/index.json | ||
env: | ||
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
- name: Install dependencies with GraphQL version ${{ matrix.graphqlversion }} | ||
run: dotnet restore -p:GraphQLTestVersion=${{ matrix.graphqlversion }} | ||
- name: Build solution [Release] | ||
if: ${{ startsWith(matrix.os, 'ubuntu') }} | ||
run: dotnet build --no-restore -c Release -p:GraphQLTestVersion=${{ matrix.graphqlversion }} | ||
Shane32 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- name: Build solution [Debug] | ||
run: dotnet build --no-restore -c Debug -p:GraphQLTestVersion=${{ matrix.graphqlversion }} | ||
- name: Test solution [Debug] | ||
run: dotnet test --no-restore --no-build | ||
|
||
buildcheck: | ||
needs: | ||
- test | ||
runs-on: ubuntu-latest | ||
if: always() | ||
steps: | ||
- name: Pass build check | ||
if: ${{ needs.test.result == 'success' }} | ||
run: exit 0 | ||
- name: Fail build check | ||
if: ${{ needs.test.result != 'success' }} | ||
run: exit 1 |
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,22 @@ | ||
name: Check if PR title contains [WIP] | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened # when PR is opened | ||
- edited # when PR is edited | ||
- synchronize # when code is added | ||
- reopened # when a closed PR is reopened | ||
|
||
jobs: | ||
check-title: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Fail build if pull request title contains [WIP] | ||
env: | ||
TITLE: ${{ github.event.pull_request.title }} | ||
if: ${{ contains(github.event.pull_request.title, '[WIP]') }} # This function is case insensitive. | ||
run: | | ||
echo Warning! PR title "$TITLE" contains [WIP]. Remove [WIP] from the title when PR is ready. | ||
exit 1 |
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
Binary file not shown.
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,24 @@ | ||
<Project> | ||
|
||
<PropertyGroup> | ||
<VersionPrefix>0.6.0-preview</VersionPrefix> | ||
<LangVersion>latest</LangVersion> | ||
<Authors>Jason Quense</Authors> | ||
<PackageLicenseExpression>MIT</PackageLicenseExpression> | ||
<GenerateDocumentationFile>true</GenerateDocumentationFile> | ||
<RepositoryType>git</RepositoryType> | ||
<PublishRepositoryUrl>true</PublishRepositoryUrl> | ||
<Deterministic>true</Deterministic> | ||
<!-- https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables --> | ||
<!-- https://github.com/clairernovotny/DeterministicBuilds --> | ||
<ContinuousIntegrationBuild Condition="'$(GITHUB_ACTIONS)' == 'true'">True</ContinuousIntegrationBuild> | ||
<DebugType>embedded</DebugType> | ||
<EmbedUntrackedSources>true</EmbedUntrackedSources> | ||
<GraphQLTestVersion>4.0.2</GraphQLTestVersion> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" Condition="'$(IsPackable)' == 'true'"/> | ||
</ItemGroup> | ||
|
||
</Project> |
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
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
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
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
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
This file was deleted.
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.
🤔 Sln file is not in the src folder. In other repositories, it is inside the src folder. What option do we choose?
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 thought about it and decided it was more appropriate here because it references files in this folder and the
.github
folder and so on. If not, then it should be in the src folder.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.
The sln file should not have to traverse up a directory - e.g.
../.github/workflows/testcode.yml
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 think that the sln file used to only reference the projects, at which point it was most appropriately in the src folder. But then you/we started adding references to the documentation and other files. So now it really should be moved in the other repos.
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.
ok