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

Turn on the CI build for PRs #204

Merged
merged 7 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from 5 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
59 changes: 59 additions & 0 deletions .github/workflows/build-dotnet-solo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to you under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

name: build-dotnet-solo

on:
workflow_dispatch:
push:
branches:
- master
pull_request:

jobs:

build:

runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [ macos-latest, ubuntu-latest, windows-latest ]

env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1

steps:

- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # 4.1.7

- name: Set up dotnet
uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee # 4.0.1
with:
dotnet-version: 8
dotnet-quality: ga

- name: Build
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove this step since dotnet test also builds the DLLs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rather not do that. With separate steps, it's easy to see without digging into whether it's a build issue or a failing tests issue.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point.

run: |
dotnet build ./src/log4net.sln

- name: Test
run: |
dotnet test ./src/log4net.sln
27 changes: 22 additions & 5 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ name: build

on:
workflow_dispatch:
push:
branches:
- master
pull_request:

jobs:

Expand All @@ -31,6 +35,10 @@ jobs:
matrix:
os: [ macos-latest, ubuntu-latest, windows-latest ]

env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1

steps:

- name: Checkout repository
Expand All @@ -47,11 +55,20 @@ jobs:
with:
node-version: 20

- name: Build and test
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_CLIE_TELEMETRY_OPTOUT: 1
- name: Setup non-windows build
if: matrix.os != 'windows-latest'
run: |
echo "DOTNET_CORE=1" >> $GITHUB_ENV

- name: Install build dependencies
run: |
npm update -g npm --no-progress
npm install --no-progress
npm test

- name: Build
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: build step is not required - npm test will build as a pre-requisite

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's true, but it's easier to tell what failed when the phases are separated.

run: |
npm run build

- name: Test
run: |
npm test