Skip to content

Commit

Permalink
Fixing GitHub Actions workflows Ubuntu 24 incompatibility (OrchardCMS…
Browse files Browse the repository at this point in the history
  • Loading branch information
Piedone authored Jan 8, 2025
1 parent aaf3345 commit 46da2ec
Showing 16 changed files with 57 additions and 68 deletions.
7 changes: 6 additions & 1 deletion .github/ISSUE_TEMPLATE/target_frameworks.md
Original file line number Diff line number Diff line change
@@ -10,7 +10,12 @@ assignees: ''
Use the minimal SDK version required, the `rollForward` rule will pick the latest version available on the machine. It's up to the user to update their SDK to the version they want in case there is an update and we don't want to force them into a newer version in case they can't install it.
- [ ] Update `src/OrchardCore.Build/TargetFrameworks.props`.
- [ ] Add a custom `AspNetCorePackagesVersion` for each TFM in `Directory.Packages.props`
- [ ] Update all `uses: actions/setup-dotnet` tasks to the required SDK version.
- [ ] Update `.github/actions/setup-dotnet/action.yml` to the required SDK versions. If dual targeting frameworks, add both, e.g.:
```yaml
dotnet-version: |
8.0.x
9.0.x
```
- [ ] Update all `dotnet publish`, `dotnet build` and `dotnet test` calls to the latest TFM, if specified.
- [ ] Update all `tasks.json` files to target the latest TFM
- [ ] Update the list of template **choices** (see the `template.json` files).
12 changes: 12 additions & 0 deletions .github/actions/setup-dotnet/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Set Up .NET
description: Centralized actions/setup-dotnet for easier updates.

runs:
using: composite
steps:
- name: Set Up .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
9.0.x
2 changes: 1 addition & 1 deletion .github/workflows/assets_validation.yml
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ concurrency:
jobs:
test-npm-build:
name: Test building assets
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Rebuild packages
2 changes: 1 addition & 1 deletion .github/workflows/close_stale_prs_issues.yml
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ on:

jobs:
close-stale-prs-issues:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/stale@v9
with:
2 changes: 1 addition & 1 deletion .github/workflows/comment_issue_on_triage.yml
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ on:

jobs:
comment-issue-on-triage:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
permissions:
issues: write
# Despite the trigger being called "issues", this would still run for setting the milestone of PRs too.
2 changes: 1 addition & 1 deletion .github/workflows/community_metrics.yml
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ permissions:
jobs:
generate-community-metrics:
name: Generate Community Metrics
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- name: Get Dates For Last Month
shell: pwsh
2 changes: 1 addition & 1 deletion .github/workflows/contributor_map.yml
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ on:
jobs:
update-contributor-map:
name: Update Contributor Map
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

steps:
- name: Update Contributor Map
5 changes: 1 addition & 4 deletions .github/workflows/docs_validation.yml
Original file line number Diff line number Diff line change
@@ -20,18 +20,15 @@ concurrency:
jobs:
validate-building-documentation:
name: Validating Building the Documentation
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
# Necessary to avoid mkdocs-git-revision-date-localized-plugin warnings.
fetch-depth: 0

- name: Install Dependencies
# Installing pip v22.0.3 is only necessary because unbuntu-latest runners include v22.0.2, which has a bug. That
# line can be removed once the runners are updated, see https://github.com/actions/runner-images?tab=readme-ov-file#available-images.
run: |
python -m pip install pip==22.0.3
pip install -r src/docs/requirements.txt -v
- name: Build Documentation
2 changes: 1 addition & 1 deletion .github/workflows/first_time_contributor.yml
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ on:

jobs:
first-time-contributor-welcome:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
# We don't use the actions/first-interaction action because it can't reference the author, nor can it comment after
# PR merge.
35 changes: 10 additions & 25 deletions .github/workflows/functional_all_db.yml
Original file line number Diff line number Diff line change
@@ -29,15 +29,12 @@ jobs:
github.event_name == 'push' ||
github.event.review.state == 'APPROVED' ||
github.event.review.state == 'CHANGES_REQUESTED'
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
container:
image: cypress/included:13.17.0
steps:
- uses: actions/checkout@v4
# We need to install dotnet in the docker container.
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- uses: ./.github/actions/setup-dotnet
- uses: actions/setup-node@v4
with:
node-version: "15"
@@ -59,17 +56,14 @@ jobs:
github.event_name == 'push' ||
github.event.review.state == 'APPROVED' ||
github.event.review.state == 'CHANGES_REQUESTED'
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
container:
image: cypress/included:13.17.0
env:
OrchardCore__OrchardCore_YesSql__EnableThreadSafetyChecks: true
steps:
- uses: actions/checkout@v4
# We need to install dotnet in the docker container.
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- uses: ./.github/actions/setup-dotnet
- name: Functional Tests
run: |
cd test/OrchardCore.Tests.Functional
@@ -90,7 +84,7 @@ jobs:
github.event_name == 'push' ||
github.event.review.state == 'APPROVED' ||
github.event.review.state == 'CHANGES_REQUESTED'
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
container:
image: cypress/included:13.17.0
services:
@@ -112,10 +106,7 @@ jobs:
OrchardCore__OrchardCore_YesSql__EnableThreadSafetyChecks: true
steps:
- uses: actions/checkout@v4
# We need to install dotnet in the docker container.
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- uses: ./.github/actions/setup-dotnet
- name: Functional Tests
run: |
cd test/OrchardCore.Tests.Functional
@@ -136,7 +127,7 @@ jobs:
github.event_name == 'push' ||
github.event.review.state == 'APPROVED' ||
github.event.review.state == 'CHANGES_REQUESTED'
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
container:
image: cypress/included:13.17.0
services:
@@ -154,10 +145,7 @@ jobs:
OrchardCore__OrchardCore_YesSql__EnableThreadSafetyChecks: true
steps:
- uses: actions/checkout@v4
# We need to install dotnet in the docker container.
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- uses: ./.github/actions/setup-dotnet
- name: Functional Tests
run: |
cd test/OrchardCore.Tests.Functional
@@ -178,7 +166,7 @@ jobs:
github.event_name == 'push' ||
github.event.review.state == 'APPROVED' ||
github.event.review.state == 'CHANGES_REQUESTED'
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
container:
image: cypress/included:13.17.0
services:
@@ -195,10 +183,7 @@ jobs:
OrchardCore__OrchardCore_YesSql__EnableThreadSafetyChecks: true
steps:
- uses: actions/checkout@v4
# We need to install dotnet in the docker container.
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- uses: ./.github/actions/setup-dotnet
- name: Functional Tests
run: |
cd test/OrchardCore.Tests.Functional
6 changes: 2 additions & 4 deletions .github/workflows/mac_unit_test_ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Unit Tests - MacOS
on:
# manual trigger
# manual trigger
workflow_dispatch:
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
@@ -11,9 +11,7 @@ jobs:
name: Unit Tests
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- uses: ./.github/actions/setup-dotnet
- name: Build and test
run: |
dotnet build -c Release /p:TreatWarningsAsErrors=true /p:RunAnalyzers=true
10 changes: 4 additions & 6 deletions .github/workflows/main_ci.yml
Original file line number Diff line number Diff line change
@@ -21,15 +21,13 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, windows-latest]
os: [ubuntu-24.04, windows-2022]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "15"
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- uses: ./.github/actions/setup-dotnet
- name: Build
# See pr_ci.yml for the reason why we disable NuGet audit warnings.
run: |
@@ -38,14 +36,14 @@ jobs:
run: |
dotnet test -c Release --no-build ./test/OrchardCore.Tests/OrchardCore.Tests.csproj
- name: Functional Tests
if: matrix.os == 'ubuntu-22.04'
if: matrix.os == 'ubuntu-24.04'
run: |
cd test/OrchardCore.Tests.Functional
npm install
npm run cms:test
npm run mvc:test
- uses: actions/upload-artifact@v4
if: matrix.os == 'ubuntu-22.04' && failure()
if: matrix.os == 'ubuntu-24.04' && failure()
with:
name: Functional Test failure
path: |
10 changes: 4 additions & 6 deletions .github/workflows/pr_ci.yml
Original file line number Diff line number Diff line change
@@ -14,16 +14,14 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, windows-latest]
os: [ubuntu-24.04, windows-2022]
name: Build & Test
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "15"
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- uses: ./.github/actions/setup-dotnet
- name: Build
# We disable NuGet audit warnings, see https://learn.microsoft.com/en-us/nuget/reference/errors-and-warnings/nu1901-nu1904.
# Security issues being discovered in NuGet packages we use can happen at any time, and thus all our CI builds that
@@ -35,14 +33,14 @@ jobs:
run: |
dotnet test -c Release --no-build ./test/OrchardCore.Tests/OrchardCore.Tests.csproj
- name: Functional Tests
if: matrix.os == 'ubuntu-22.04'
if: matrix.os == 'ubuntu-24.04'
run: |
cd test/OrchardCore.Tests.Functional
npm install
npm run cms:test
npm run mvc:test
- uses: actions/upload-artifact@v4
if: matrix.os == 'ubuntu-22.04' && failure()
if: matrix.os == 'ubuntu-24.04' && failure()
with:
name: functional-test-failure
path: |
6 changes: 2 additions & 4 deletions .github/workflows/preview_ci.yml
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ env:
DOTNET_CLI_TELEMETRY_OPTOUT: true
jobs:
test:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
name: Build, Test, Deploy
steps:
- uses: actions/checkout@v4
@@ -25,10 +25,8 @@ jobs:
if: steps.check-publish.outputs.should-publish == 'true'
with:
node-version: "15"
- uses: actions/setup-dotnet@v4
- uses: ./.github/actions/setup-dotnet
if: steps.check-publish.outputs.should-publish == 'true'
with:
dotnet-version: '9.0.x'
- name: Set build number
if: steps.check-publish.outputs.should-publish == 'true'
run: echo "BuildNumber=$(( $GITHUB_RUN_NUMBER + 16368 ))" >> $GITHUB_ENV
20 changes: 9 additions & 11 deletions .github/workflows/release_ci.yml
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, windows-latest]
os: [ubuntu-24.04, windows-2022]
steps:
- name: Get the version
id: get_version
@@ -33,11 +33,9 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: "15"
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- uses: ./.github/actions/setup-dotnet
- name: Set build number
if: matrix.os == 'ubuntu-22.04'
if: matrix.os == 'ubuntu-24.04'
run: echo "BuildNumber=$(( $GITHUB_RUN_NUMBER + 15471 ))" >> $GITHUB_ENV
- name: Build
# NuGetAudit is intentionally not disabled here like it is for other CI builds, because we need to address any
@@ -48,35 +46,35 @@ jobs:
run: |
dotnet test -c Release --no-build ./test/OrchardCore.Tests/OrchardCore.Tests.csproj
- name: Functional Tests
if: matrix.os == 'ubuntu-22.04'
if: matrix.os == 'ubuntu-24.04'
run: |
cd test/OrchardCore.Tests.Functional
npm install
npm run cms:test
npm run mvc:test
- uses: actions/upload-artifact@v4
if: matrix.os == 'ubuntu-22.04' && failure()
if: matrix.os == 'ubuntu-24.04' && failure()
with:
name: Functional Test failure
path: |
test/OrchardCore.Tests.Functional/cms-tests/cypress/screenshots
src/OrchardCore.Cms.Web/App_Data_Tests/logs
- name: Deploy release NuGet packages
if: matrix.os == 'ubuntu-22.04'
if: matrix.os == 'ubuntu-24.04'
run: |
dotnet pack -c Release --no-build -p:Version=${{ steps.get_version.outputs.VERSION }} -p:TreatWarningsAsErrors=false
dotnet nuget push './src/**/*.nupkg' -t 600 -k ${{secrets.NUGET_API_KEY}} -s https://api.nuget.org/v3/index.json --skip-duplicate
- name: Set up Docker Buildx
if: matrix.os == 'ubuntu-22.04'
if: matrix.os == 'ubuntu-24.04'
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
if: matrix.os == 'ubuntu-22.04'
if: matrix.os == 'ubuntu-24.04'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Deploy release docker images
if: matrix.os == 'ubuntu-22.04'
if: matrix.os == 'ubuntu-24.04'
shell: pwsh
run: |
Get-ChildItem ./src/OrchardCore.Cms.Web/App_Data -Recurse | Remove-Item -Recurse -Confirm:$false
2 changes: 1 addition & 1 deletion .github/workflows/validate_pr.yml
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ on:
jobs:
validate-pull-request:
name: Validate Pull Request
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
timeout-minutes: 3
steps:
- name: Check for Merge Conflict in PR

0 comments on commit 46da2ec

Please sign in to comment.