Skip to content

Commit 2e8708e

Browse files
committed
Fixing test/merge workflow
1 parent 845e2a7 commit 2e8708e

File tree

3 files changed

+38
-63
lines changed

3 files changed

+38
-63
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3,49 +3,20 @@ name: 🛠️ build
33
on:
44
workflow_dispatch:
55
push:
6+
branches:
7+
- main
68
tags:
79
- "[0-9]+.[0-9]+.[0-9]+"
810
- "[0-9]+.[0-9]+.[0-9]+-**"
911

1012
jobs:
1113
test:
1214
name: 🧪 Run tests
13-
runs-on: ubuntu-latest
14-
strategy:
15-
matrix:
16-
roslyn: ["3.11", "4.0", "4.4"]
17-
steps:
18-
- name: 🛒 Check-out code
19-
uses: actions/checkout@v4
20-
21-
- name: 📐 Setup .NET Core SDK
22-
uses: actions/setup-dotnet@v4
23-
with:
24-
global-json-file: src/global.json
25-
26-
- name: 🔍 Enable problem matchers
27-
run: echo "::add-matcher::.github/matchers/dotnet.json"
28-
29-
- name: 🛠️ Build code
30-
run: dotnet build --configuration Release
31-
32-
- name: 🧪 Testing ${{ matrix.roslyn }} code
33-
run: >
34-
dotnet test
35-
--configuration Release
36-
-p:GeneratorVersion=${{ matrix.roslyn }}
37-
38-
- name: Upload Test Results
39-
if: failure()
40-
uses: actions/upload-artifact@v4
41-
with:
42-
name: verify-test-results
43-
path: |
44-
**/*.received.*
15+
uses: ./.github/workflows/test.yml
4516

4617
build:
4718
name: 🛠️ Build
48-
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
19+
if: github.event_name == 'push' && github.ref_type == 'tag'
4920
runs-on: ubuntu-latest
5021
needs: test
5122
steps:

.github/workflows/pr.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: ✏️ pr
2+
3+
on:
4+
pull_request:
5+
types: [opened, reopened, edited, synchronize]
6+
7+
jobs:
8+
test:
9+
name: 🧪 Run tests
10+
uses: ./.github/workflows/test.yml
11+
12+
merge:
13+
name: 🤖 Merge
14+
runs-on: ubuntu-latest
15+
needs: test
16+
if: |
17+
github.event_name == 'pull_request'
18+
&& github.event.pull_request.user.login == 'dependabot[bot]'
19+
&& github.repository == 'distantcam/autoctor'
20+
permissions:
21+
pull-requests: write
22+
contents: write
23+
steps:
24+
- name: 📡 Dependabot metadata
25+
id: dependabot-metadata
26+
uses: dependabot/fetch-metadata@v2
27+
28+
- name: ✔️ Merge PR
29+
if: steps.dependabot-metadata.outputs.dependency-group == 'tunit'
30+
run: gh pr merge --auto --merge "$PR_URL"
31+
env:
32+
PR_URL: ${{ github.event.pull_request.html_url }}
33+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test.yml

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
name: 🧪 test
22

33
on:
4-
workflow_dispatch:
5-
push:
6-
branches:
7-
- main
8-
pull_request:
9-
types: [opened, reopened, edited, synchronize]
4+
workflow_call:
105

116
jobs:
127
test:
@@ -43,27 +38,3 @@ jobs:
4338
name: verify-test-results
4439
path: |
4540
**/*.received.*
46-
47-
merge:
48-
name: 🤖 Merge
49-
runs-on: ubuntu-latest
50-
if: |
51-
github.event_name == 'pull_request'
52-
&& github.event.pull_request.user.login == 'dependabot[bot]'
53-
&& github.repository == 'distantcam/autoctor'
54-
permissions:
55-
pull-requests: write
56-
contents: write
57-
steps:
58-
- name: 📡 Dependabot metadata
59-
id: dependabot-metadata
60-
uses: dependabot/fetch-metadata@v2
61-
62-
- name: ✔️ Merge PR
63-
if: |
64-
steps.dependabot-metadata.outputs.dependency-group == 'tunit'
65-
&& steps.dependabot-metadata.outputs.update-type == 'version-update:semver-patch'
66-
run: gh pr merge --auto --merge "$PR_URL"
67-
env:
68-
PR_URL: ${{ github.event.pull_request.html_url }}
69-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)