Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
42 changes: 34 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ on:
branches: [ main ]

jobs:
workflow-lint:
name: Lint GitHub Actions workflows
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: actionlint
uses: rhysd/actionlint@v1.7.12

changes:
name: Detect package-impacting changes
runs-on: ubuntu-latest
Expand All @@ -21,7 +30,7 @@ jobs:
any_changed: ${{ steps.flags.outputs.any_changed }}
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
fetch-depth: 0

Expand All @@ -33,6 +42,12 @@ jobs:
workflows:
- '.github/workflows/ci.yml'
- '.github/workflows/release.yml'
tooling:
- 'Directory.Build.props'
- 'Directory.Packages.props'
- 'src/analyticsLibrary.ReleaseTooling/**'
- 'tools/analyticsLibrary.NuGetMaintenance/**'
- 'tests/analyticsLibrary.ReleaseTooling.Tests/**'
core:
- 'src/analyticsLibrary.Core/**'
algorithms:
Expand All @@ -51,6 +66,13 @@ jobs:
- name: Compute effective package flags
id: flags
run: |
if [ '${{ steps.filter.outputs.tooling }}' = "true" ]; then
for n in core_changed algorithms_changed statistics_changed excel_changed access_changed hadoop_changed root_changed any_changed; do
echo "${n}=true" >> "$GITHUB_OUTPUT"
done
exit 0
fi

WORKFLOWS_CHANGED='${{ steps.filter.outputs.workflows }}'
set_flag() {
local name="$1"
Expand Down Expand Up @@ -86,7 +108,9 @@ jobs:
no-package-changes:
name: No package-impacting changes
runs-on: ubuntu-latest
needs: changes
needs:
- changes
- workflow-lint
if: needs.changes.outputs.any_changed != 'true'
steps:
- name: Skip message
Expand All @@ -95,15 +119,17 @@ jobs:
build-test-pack:
name: Build, Test, and Pack
runs-on: ubuntu-latest
needs: changes
needs:
- changes
- workflow-lint
if: needs.changes.outputs.any_changed == 'true'

steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Setup .NET
uses: actions/setup-dotnet@v4
uses: actions/setup-dotnet@v5
with:
dotnet-version: '8.0.x'

Expand All @@ -114,7 +140,7 @@ jobs:
run: dotnet build -c Release --no-restore

- name: Test
run: dotnet test -c Release --no-build --verbosity normal
run: dotnet test -c Release --no-build --verbosity normal --filter "Category!=Integration"

- name: Pack
run: |
Expand Down Expand Up @@ -180,7 +206,7 @@ jobs:
local package_name="$2"
if [ "$should_pack" = "true" ]; then
EXPECTED=$((EXPECTED+1))
if ! ls ./artifacts/${package_name}.*.nupkg 1>/dev/null 2>&1; then
if ! ls "./artifacts/${package_name}."*.nupkg 1>/dev/null 2>&1; then
echo "ERROR: Expected package not found: ${package_name}"
exit 1
fi
Expand All @@ -202,7 +228,7 @@ jobs:
echo "All expected packages found."

- name: Upload artifacts
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: nuget-packages-${{ github.run_id }}
path: ./artifacts/*.nupkg
Expand Down
Loading
Loading