Skip to content

Commit

Permalink
Merge branch 'main' into refactor-integration-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DaveSkender committed Apr 1, 2024
2 parents c3fff23 + db11534 commit 3f29598
Show file tree
Hide file tree
Showing 10 changed files with 85 additions and 52 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/deploy-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:
required: true

concurrency:
group: package-deployer
group: ${{ inputs.environment }}
cancel-in-progress: true

jobs:
Expand All @@ -29,12 +29,12 @@ jobs:

steps:

- name: Checkout repository
- name: Checkout source
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install GitVersion
- name: Setup GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: "5.x"
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
replace: "<PackageReleaseNotes>https://github.com/DaveSkender/Stock.Indicators/releases/tag/${{ steps.compose.outputs.version }}</PackageReleaseNotes>"
regex: false

- name: Install .NET SDK
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.x"
Expand All @@ -85,7 +85,7 @@ jobs:
--output NuGet
-p:PackageVersion=${{ steps.compose.outputs.version }}
- name: Save NuGet package
- name: Save package
uses: actions/upload-artifact@v3
with:
name: packages
Expand Down Expand Up @@ -127,19 +127,19 @@ jobs:
echo "| Version ID | ${{ needs.build.outputs.version }} |"
} >> $GITHUB_STEP_SUMMARY
- name: Install .NET SDK
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.x"
dotnet-quality: "ga"

- name: Install NuGet tool
- name: Setup NuGet
uses: nuget/setup-nuget@v1
with:
nuget-api-key: ${{ secrets.NUGET_TOKEN }}
nuget-version: '6.x'

- name: Download NuGet package
- name: Download package
uses: actions/download-artifact@v3
with:
name: packages
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Deploy website

on: [workflow_dispatch]
on: workflow_dispatch

concurrency:
group: docs-website
Expand All @@ -20,7 +20,7 @@ jobs:
- name: Checkout source
uses: actions/checkout@v4

- name: Install Ruby
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
working-directory: docs
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Lint PR"
name: "Pull request"

on:
pull_request_target:
Expand All @@ -12,7 +12,7 @@ permissions:

jobs:
main:
name: validate PR title
name: lint PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
Expand All @@ -39,7 +39,7 @@ jobs:
# event triggers in your workflow.
ignoreLabels: |
bot
ignore-semantic-pull-request
dependencies
- uses: marocchino/sticky-pull-request-comment@v2
# When the previous steps fails, the workflow would stop. By adding this
Expand All @@ -57,9 +57,15 @@ jobs:
#### Pull request title naming convention
Our PR title name taxonomy is `type: Subject`, where **type** is typically
*feat*, *fix*, or *chore*, and **subject** is a phrase (proper noun) that starts with a capitalized letter.
The *chore* type usually has a subject that starts with an action verb like *Add* or *Update*.
Examples: `feat: Admin portal login`, `fix: Divide by zero bug in SMA`, and `chore: Update user docs`.
*feat*, *fix*, or *chore*, and **subject** is a phrase (proper noun) that starts
with a capitalized letter. The *chore* type usually has a subject that starts
with an action verb like *Add* or *Update*. Examples:
- _feat: Admin portal login_
- _fix: Divide by zero bug in SMA_
- _chore: Update packages_
- _docs: Improve setup guidance_
See the [Conventional Commits specification](https://www.conventionalcommits.org) for more information.
# Delete a previous comment when the issue has been resolved
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Checkout source
uses: actions/checkout@v4

- name: Install Ruby
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
working-directory: docs
Expand Down Expand Up @@ -56,3 +56,7 @@ jobs:
npx pa11y-ci \
--sitemap http://127.0.0.1:4000/sitemap.xml \
--sitemap-exclude "/*.pdf"
- name: Kill site (failsafe)
if: always()
run: pkill -f jekyll
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Checkout source
uses: actions/checkout@v4

- name: Install Ruby
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
working-directory: docs
Expand All @@ -34,7 +34,7 @@ jobs:
pwd
bundle install
- name: Install HTML Proofer
- name: Setup HTML Proofer
run: gem install html-proofer

- name: Replace "data-src"
Expand Down Expand Up @@ -68,6 +68,10 @@ jobs:
run: |
htmlproofer _site \
--no-enforce-https \
--ignore-status-codes "0,403,406,408,429,503,999" \
--ignore-status-codes "0,302,403,406,408,429,503,999" \
--swap-urls "https\://dotnet.stockindicators.dev:http\://127.0.0.1:4000" \
--ignore-urls "/fonts.gstatic.com/"
- name: Kill site (failsafe)
if: always()
run: pkill -f jekyll
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ on:

jobs:
build:
name: build projects
name: build only
runs-on: ubuntu-latest

steps:

- name: Checkout repository
- name: Checkout source
uses: actions/checkout@v4

- name: Install .NET SDK
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.x"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,38 +8,55 @@ on:
branches: ["main","v3"]

jobs:

test:
name: unit tests
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}

steps:
permissions:
contents: read
pull-requests: write

strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
dotnet-version: ["2.0.x", "6.x", "8.x"]

- name: Clean workspace
run: |
rm -rf ./test-indicators/* || true
rm -rf ./test-indicators/.??* || true
rm -rf ./NuGet/* || true
rm -rf ./NuGet/.??* || true
env:

- name: Checkout repository
# identifying primary configuration so only one reports coverage
IS_PRIMARY: ${{ matrix.os == 'ubuntu-latest' && matrix.dotnet-version == '8.x' }}

# .NET SDK versions in the matrix that support `ga` quality spec
# versions before 5.x do not support it
SUPPORT_GA: ${{ contains(fromJson('["6.x", "8.x"]'), matrix.dotnet-version) }}

steps:

- name: Checkout source
uses: actions/checkout@v4

- name: Install .NET SDK
- name: Setup .NET
id: dotnet-new
uses: actions/setup-dotnet@v4
if: env.SUPPORT_GA == 'true'
with:
dotnet-version: "8.x"
dotnet-version: ${{ matrix.dotnet-version }}
dotnet-quality: "ga"

- name: Build solution
- name: Setup .NET (older)
uses: actions/setup-dotnet@v4
if: env.SUPPORT_GA == 'false'
with:
dotnet-version: ${{ matrix.dotnet-version }}

- name: Build library
run: >
dotnet build
--configuration Release
--property:ContinuousIntegrationBuild=true
-warnAsError
- name: Test indicators
id: test-library
env:
ALPACA_KEY: ${{ secrets.ALPACA_KEY }}
ALPACA_SECRET: ${{ secrets.ALPACA_SECRET }}
Expand All @@ -52,8 +69,10 @@ jobs:
--collect:"XPlat Code Coverage"
--results-directory ./test-indicators
# the remaining steps are only needed from one primary instance

- name: Test other items
id: test-other
if: env.IS_PRIMARY == 'true'
run: >
dotnet test tests/other/Tests.Other.csproj
--configuration Release
Expand All @@ -62,20 +81,19 @@ jobs:
--logger trx
--results-directory ./test-other
- name: Post tests summary
uses: bibipkins/dotnet-test-reporter@v1.3.3
if: ${{ github.event_name == 'pull_request' && (success() || (failure() && (steps.test-library.conclusion == 'failure' || steps.test-other.conclusion == 'failure'))) }}
- name: Post test summary
uses: bibipkins/dotnet-test-reporter@v1.4.1
if: env.IS_PRIMARY == 'true' && always()
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
comment-title: ""
results-path: ./test-indicators/**/*.trx
results-path: ./test-indicators/**/*.trx
coverage-path: ./test-indicators/**/coverage.cobertura.xml
coverage-type: cobertura

- name: Post coverage to Codacy
- name: Publish coverage to Codacy
uses: codacy/codacy-coverage-reporter-action@v1
if: env.IS_PRIMARY == 'true'
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: ./test-indicators/**/coverage.cobertura.xml
# or a comma-separated list for multiple reports
# coverage-reports: <PATH_TO_REPORT>, <PATH_TO_REPORT>
8 changes: 4 additions & 4 deletions .github/workflows/test-performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ concurrency:
group: test-performance
cancel-in-progress: true

on: [workflow_dispatch]
on: workflow_dispatch

jobs:
analyze:
runs-on: ubuntu-22.04

steps:

- name: Checkout repository
- name: Checkout source
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install GitVersion
- name: Setup GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: "5.x"
Expand All @@ -31,7 +31,7 @@ jobs:
useConfigFile: true
configFilePath: gitversion.yml

- name: Install .NET SDK
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.x"
Expand Down
7 changes: 4 additions & 3 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,10 @@ dotnet run -c Release --filter *.GetAdx

## Documentation

This site uses [GitHub Pages](https://pages.github.com) and [Jekyll](https://jekyllrb.com) construction with Front Matter.
The documentation site is in the `docs` folder. Build the site locally to test that it works properly.
See GitHub documentation for initial [Ruby and Jekyll setup instructions for Github Pages](https://docs.github.com/en/pages/setting-up-a-github-pages-site-with-jekyll/testing-your-github-pages-site-locally-with-jekyll).
This site uses [Jekyll](https://jekyllrb.com) construction with _Front Matter_.
Our documentation site code is in the `docs` folder.
Build the site locally to test that it works properly.
See [Ruby Jekyll documentation](https://jekyllrb.com/docs) for initial setup.

```bash
# from /docs folder
Expand Down

0 comments on commit 3f29598

Please sign in to comment.