Skip to content

Commit 57e1f47

Browse files
authored
Merge pull request #127 from autofac/feature/build-update
- Change build to GitHub Actions. This means new Autofac.Extensions.DependencyInjection packages will be published in GitHub Packages rather than on MyGet. - Switch to use the central .github folder for the organization instead of one-off versions in the repo. - Update analyzer rules to match core Autofac. - Fix analyzer issues due to new rules.
2 parents f2170d3 + f263fd4 commit 57e1f47

File tree

86 files changed

+685
-1030
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+685
-1030
lines changed

.editorconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ indent_size = 2
163163

164164
; .NET solution files - match defaults for VS
165165
[*.sln]
166+
end_of_line = crlf
166167
indent_style = tab
167168

168169
; Config - match XML and default nuget.config template
@@ -197,3 +198,7 @@ charset = utf-8-bom
197198
; ReStructuredText - standard indentation format from examples
198199
[*.rst]
199200
indent_size = 2
201+
202+
# YAML - match standard YAML like Kubernetes and GitHub Actions
203+
[*.{yaml,yml}]
204+
indent_size = 2

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*.png binary
1414
*.gif binary
1515

16-
*.cs text=auto diff=csharp
16+
*.cs text=auto diff=csharp
1717
*.vb text=auto
1818
*.resx text=auto
1919
*.c text=auto

.github/CONTRIBUTING.md

Lines changed: 0 additions & 88 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 0 additions & 39 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 0 additions & 20 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/question.md

Lines changed: 0 additions & 23 deletions
This file was deleted.

.github/PULL_REQUEST_TEMPLATE/pull_request_template.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Build and Test
2+
on:
3+
workflow_call:
4+
secrets:
5+
CODECOV_TOKEN:
6+
description: Token for uploading code coverage metrics to CodeCov.io.
7+
required: true
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
- name: Setup .NET
15+
uses: actions/setup-dotnet@v4
16+
with:
17+
dotnet-version: |
18+
6.0.x
19+
7.0.x
20+
8.0.x
21+
- name: Build and test
22+
run: dotnet msbuild ./default.proj
23+
- name: Upload coverage
24+
uses: codecov/codecov-action@v5
25+
with:
26+
fail_ci_if_error: true
27+
files: artifacts/logs/*/coverage.cobertura.xml
28+
token: ${{ secrets.CODECOV_TOKEN }}
29+
- name: Upload package artifacts
30+
uses: actions/upload-artifact@v4
31+
with:
32+
name: packages
33+
path: |
34+
artifacts/packages/*.nupkg
35+
artifacts/packages/*.snupkg

.github/workflows/ci.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Continuous Integration
2+
on:
3+
pull_request:
4+
branches:
5+
- develop
6+
- master
7+
push:
8+
branches:
9+
- develop
10+
- master
11+
- feature/*
12+
tags:
13+
- v[0-9]+.[0-9]+.[0-9]+
14+
# If multiple pushes happen quickly in succession, cancel the running build and
15+
# start a new one.
16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.ref }}
18+
cancel-in-progress: true
19+
jobs:
20+
# Linting
21+
dotnet-format:
22+
uses: ./.github/workflows/dotnet-format.yml
23+
pre-commit:
24+
uses: ./.github/workflows/pre-commit.yml
25+
# Build and test
26+
build:
27+
uses: ./.github/workflows/build.yml
28+
secrets:
29+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
30+
# Publish beta and release packages.
31+
publish:
32+
uses: ./.github/workflows/publish.yml
33+
needs:
34+
- build
35+
- dotnet-format
36+
- pre-commit
37+
if: ${{ github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/tags/v') }}
38+
secrets:
39+
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: dotnet format
2+
on:
3+
workflow_call:
4+
jobs:
5+
dotnet-format:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v4
9+
- name: Setup .NET 8
10+
uses: actions/setup-dotnet@v4
11+
with:
12+
dotnet-version: 8.0.x
13+
- name: dotnet format
14+
run: dotnet format Autofac.Extensions.DependencyInjection.sln --verify-no-changes

0 commit comments

Comments
 (0)