Skip to content
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

chore: migrate build to GitHub Actions #1112

Merged
merged 54 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
51e8906
base action
DaveSkender Nov 7, 2023
1ae2ca8
add build path
DaveSkender Nov 7, 2023
345e67b
add gitversion and unit tests
DaveSkender Nov 7, 2023
b3cf0f8
update gitversion steps
DaveSkender Nov 7, 2023
5f2d3b5
rearrange steps
DaveSkender Nov 7, 2023
62bb024
add gitversion console output
DaveSkender Nov 7, 2023
2b52460
change fetch depth
DaveSkender Nov 7, 2023
112bdf7
change output format
DaveSkender Nov 7, 2023
10068d6
fix typo
DaveSkender Nov 7, 2023
12b853f
fix parameter wrapping
DaveSkender Nov 7, 2023
f0763f3
fix line wrapping, again
DaveSkender Nov 7, 2023
1c54662
more tweaks
DaveSkender Nov 7, 2023
dacf9e8
remove code coverage, for now
DaveSkender Nov 7, 2023
e671e0b
test and upload results
DaveSkender Nov 7, 2023
397a8cf
add NuGet packaging
DaveSkender Nov 8, 2023
135d811
fix version number
DaveSkender Nov 8, 2023
1df0de3
rename action
DaveSkender Nov 8, 2023
fad9b14
fix path
DaveSkender Nov 8, 2023
feb2f19
simplify package path
DaveSkender Nov 8, 2023
fde2f51
more
DaveSkender Nov 8, 2023
dba082a
remove explicit package version
DaveSkender Nov 8, 2023
12a8bf0
add different package version format
DaveSkender Nov 8, 2023
23fb692
attempt to use node 18
DaveSkender Nov 8, 2023
47a6df2
output experiment
DaveSkender Nov 8, 2023
50644b5
adjust output
DaveSkender Nov 8, 2023
82ae736
attempt to split load
DaveSkender Nov 8, 2023
a2600be
separate pack and test
DaveSkender Nov 8, 2023
05186b1
fix build
DaveSkender Nov 8, 2023
b9bc0d6
add examples build
DaveSkender Nov 8, 2023
96a658b
fix path
DaveSkender Nov 8, 2023
a45e7e1
fix paths
DaveSkender Nov 8, 2023
03ec48a
add code coverage summary
DaveSkender Nov 8, 2023
29e5200
update coverage params
DaveSkender Nov 8, 2023
aabe71d
add test results summary
DaveSkender Nov 8, 2023
c894588
update parameters
DaveSkender Nov 8, 2023
ac0b895
add trx loggins
DaveSkender Nov 8, 2023
99aa814
fixes
DaveSkender Nov 8, 2023
6d78f70
fixes
DaveSkender Nov 8, 2023
0690b65
refactor naming conventions
DaveSkender Nov 8, 2023
138e5d5
remove Azure DevOps build
DaveSkender Nov 8, 2023
89c7fd9
remove tests from package build
DaveSkender Nov 8, 2023
43274e7
nullstring for test results title
DaveSkender Nov 8, 2023
0cd9b8c
cosmetic rename of CodeQL
DaveSkender Nov 9, 2023
c820afa
Merge branch 'main' into perf-action
DaveSkender Nov 9, 2023
22b1b46
split indicator tests
DaveSkender Nov 9, 2023
51a603b
change other tests path
DaveSkender Nov 9, 2023
2255be9
fix coverage path
DaveSkender Nov 9, 2023
e25c29c
add workspace clean step
DaveSkender Nov 9, 2023
e5ee634
revert irongut version
DaveSkender Nov 9, 2023
0d1f7df
use alternate output folder for other tests
DaveSkender Nov 9, 2023
1db9260
remove redundant test reporter
DaveSkender Nov 9, 2023
9abc7bc
add initial staging deployer
DaveSkender Nov 9, 2023
37f1fc5
update deployer
DaveSkender Nov 9, 2023
141f348
remove obsolete separate packaging
DaveSkender Nov 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 0 additions & 105 deletions .github/build.main.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
name: "CodeQL"
name: "build"
run-name: Test CodeQL

on:
push:
branches: ["main"]
paths:
- 'src/**'
- 'tests/**'

pull_request:
branches: ["main"]
paths:
- 'src/**'
- 'tests/**'
- ".github/workflows/build-codeql.yml"

schedule:
- cron: "16 12 * * 3"

jobs:
analyze:
name: analyze
name: CodeQL
runs-on: ubuntu-latest
permissions:
actions: read
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/build-examples.yml
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
80 changes: 80 additions & 0 deletions .github/workflows/build-indicators.yml
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() }}
109 changes: 109 additions & 0 deletions .github/workflows/deploy-staging.yml
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 }}
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
name: test docs
name: docs
run-name: Test doc site a11y

on:
pull_request:
branches: [main]
paths:
- 'docs/**'
- ".github/workflows/docs-test-a11y.yml"

env:
JEKYLL_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
testing:
name: a11y
name: test a11y
runs-on: ubuntu-latest

steps:
Expand Down
Loading
Loading