-
Notifications
You must be signed in to change notification settings - Fork 248
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: migrate build to GitHub Actions (#1112)
- Loading branch information
1 parent
8589edc
commit 24d4e8a
Showing
13 changed files
with
242 additions
and
114 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
8 changes: 6 additions & 2 deletions
8
.github/workflows/codeql.yml → .github/workflows/build-codeql.yml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: "build" | ||
run-name: Build examples | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
paths: | ||
- docs/examples/** | ||
|
||
pull_request: | ||
branches: ["main"] | ||
paths: | ||
- docs/examples/** | ||
- ".github/workflows/build-examples.yml" | ||
|
||
jobs: | ||
build: | ||
name: examples | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build examples | ||
run: > | ||
dotnet build docs/examples/Examples.sln | ||
--configuration Release | ||
--property:ContinuousIntegrationBuild=true | ||
-warnAsError |
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,80 @@ | ||
name: "build" | ||
run-name: Test indicators | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
paths: | ||
- "src/**" | ||
|
||
pull_request: | ||
branches: ["main"] | ||
paths: | ||
- "src/**" | ||
- ".github/workflows/build-indicators.yml" | ||
|
||
jobs: | ||
|
||
testing: | ||
name: test indicators | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
- name: Clean workspace | ||
run: | | ||
rm -rf ./* || true | ||
rm -rf ./.??* || true | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install .NET SDK | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: "7.x" | ||
dotnet-quality: "ga" | ||
|
||
- name: Build solution | ||
run: > | ||
dotnet build | ||
--configuration Release | ||
--property:ContinuousIntegrationBuild=true | ||
-warnAsError | ||
- name: Test indicators | ||
run: > | ||
dotnet test tests/indicators/Tests.Indicators.csproj | ||
--configuration Release | ||
--no-build | ||
--verbosity normal | ||
--logger trx | ||
--collect:"XPlat Code Coverage" | ||
--results-directory ./test-indicators | ||
- name: Test other items | ||
run: > | ||
dotnet test tests/other/Tests.Other.csproj | ||
--configuration Release | ||
--no-build | ||
--verbosity normal | ||
--logger trx | ||
--results-directory ./test-other | ||
- name: Update tests summary | ||
uses: bibipkins/[email protected] | ||
if: github.event_name == 'pull_request' | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
comment-title: "" | ||
results-path: ./test-indicators/**/*.trx | ||
coverage-path: ./test-indicators/**/coverage.cobertura.xml | ||
coverage-type: cobertura | ||
coverage-threshold: 95 | ||
|
||
- name: Save test results | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: test-results | ||
path: ./test-indicators | ||
if: ${{ always() }} |
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,109 @@ | ||
name: "deploy" | ||
run-name: Deploy to staging | ||
|
||
concurrency: | ||
group: staging | ||
cancel-in-progress: true | ||
|
||
on: [workflow_dispatch] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
nuget-version: "${{ steps.gitversion.outputs.nuGetVersion }}" | ||
filename-nupkg: "Skender.Stock.Indicators.${{ steps.gitversion.outputs.nuGetVersion }}.nupkg" | ||
filename-snupkg: "Skender.Stock.Indicators.${{ steps.gitversion.outputs.nuGetVersion }}.snupkg" | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Install GitVersion | ||
uses: gittools/actions/gitversion/setup@v0 | ||
with: | ||
versionSpec: "5.x" | ||
preferLatestVersion: true | ||
|
||
- name: Determine version | ||
id: gitversion | ||
uses: gittools/actions/gitversion/execute@v0 | ||
with: | ||
updateAssemblyInfo: true | ||
useConfigFile: true | ||
configFilePath: gitversion.yml | ||
|
||
- name: Install .NET SDK | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: "7.x" | ||
dotnet-quality: "ga" | ||
|
||
- name: Build library | ||
run: > | ||
dotnet build src/Indicators.csproj | ||
--configuration Release | ||
--property:Version=${{ steps.gitversion.outputs.nuGetVersion }} | ||
--property:ContinuousIntegrationBuild=true | ||
-warnAsError | ||
- name: Pack for NuGet | ||
run: > | ||
dotnet pack src/Indicators.csproj | ||
--configuration Release | ||
--no-build | ||
--include-symbols | ||
--output NuGet | ||
-p:PackageVersion=${{ steps.gitversion.outputs.nuGetVersion }} | ||
- name: Save NuGet package | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: packages | ||
path: NuGet | ||
|
||
- name: Show version | ||
run: | | ||
{ | ||
echo "### Identified semantic version" | ||
echo "| Variable | Value |" | ||
echo "| --------------- | ----------------------------------------------- |" | ||
echo "| Major | ${{ steps.gitversion.outputs.major }} |" | ||
echo "| Minor | ${{ steps.gitversion.outputs.minor }} |" | ||
echo "| Patch | ${{ steps.gitversion.outputs.patch }} |" | ||
echo "| PreReleaseTag | ${{ steps.gitversion.outputs.preReleaseTag }} |" | ||
echo "| MajorMinorPatch | ${{ steps.gitversion.outputs.majorMinorPatch }} |" | ||
echo "| SemVer | ${{ steps.gitversion.outputs.semVer }} |" | ||
echo "| NuGetVersion | ${{ steps.gitversion.outputs.nuGetVersion }} |" | ||
} >> $GITHUB_STEP_SUMMARY | ||
deploy: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
|
||
environment: | ||
name: staging | ||
url: "${{ vars.NUGET_DOWNLOAD_PREFIX }}${{ needs.build.outputs.nuget-version }}" | ||
|
||
steps: | ||
- uses: actions/setup-dotnet@v3 | ||
with: | ||
source-url: ${{ vars.NUGET_PUBLISH_URL }} | ||
env: | ||
NUGET_AUTH_TOKEN: ${{secrets.NUGET_TOKEN}} | ||
|
||
- name: Download NuGet package | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: packages | ||
path: NuGet | ||
|
||
- name: Show publish preview | ||
run: | | ||
echo ${{ vars.NUGET_PUBLISH_URL }} | ||
echo ${{ vars.NUGET_DOWNLOAD_PREFIX }} | ||
echo "dotnet nuget push NuGet/*.nupkg" | ||
echo ${{ needs.build.outputs.filename-nupkg }} | ||
echo ${{ needs.build.outputs.filename-snupkg }} |
7 changes: 5 additions & 2 deletions
7
.github/workflows/a11y.yml → .github/workflows/docs-test-a11y.yml
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
Oops, something went wrong.