-
Notifications
You must be signed in to change notification settings - Fork 2
99 lines (91 loc) · 3.62 KB
/
test.yml
File metadata and controls
99 lines (91 loc) · 3.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: Test
on:
push:
branches: [main]
paths-ignore: ['**/*.md', '**/*.png', '**/*.txt']
pull_request:
branches: [main, preview]
types: [opened, reopened, synchronize, ready_for_review]
paths-ignore: ['**/*.md', '**/*.png', '**/*.txt']
env:
CONFIGURATION: 'Release'
permissions:
contents: read
pull-requests: read
jobs:
checks_tests_need:
runs-on: ubuntu-latest
outputs:
abstractions_changed: ${{ steps.filter.outputs.abstractions }}
cosmosdb_changed: ${{ steps.filter.outputs.cosmosdb }}
dapper_changed: ${{ steps.filter.outputs.dapper }}
efcore_changed: ${{ steps.filter.outputs.efcore }}
mongodb_changed: ${{ steps.filter.outputs.mongodb }}
nhibernate_changed: ${{ steps.filter.outputs.nhibernate }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Filter paths to trigger tests
id: filter
uses: dorny/paths-filter@v3
with:
filters: |
abstractions:
- '**/.github/workflows/test.yml'
- '**/FeatureManagement.Database.Abstractions/**'
- '**/FeatureManagement.Database.Tests/**'
cosmosdb:
- '**/.github/workflows/test.yml'
- '**/FeatureManagement.Database.Abstractions/**'
- '**/FeatureManagement.Database.CosmosDB/**'
- '**/FeatureManagement.Database.CosmosDB.Tests/**'
dapper:
- '**/.github/workflows/test.yml'
- '**/FeatureManagement.Database.Abstractions/**'
- '**/FeatureManagement.Database.Dapper/**'
- '**/FeatureManagement.Database.Dapper.Tests/**'
efcore:
- '**/.github/workflows/test.yml'
- '**/FeatureManagement.Database.Abstractions/**'
- '**/FeatureManagement.Database.EntityFrameworkCore*/**'
- '**/FeatureManagement.Database.EntityFrameworkCore*.Tests/**'
mongodb:
- '**/.github/workflows/test.yml'
- '**/FeatureManagement.Database.Abstractions/**'
- '**/FeatureManagement.Database.MongoDB/**'
- '**/FeatureManagement.Database.MongoDB.Tests/**'
nhibernate:
- '**/.github/workflows/test.yml'
- '**/FeatureManagement.Database.Abstractions/**'
- '**/FeatureManagement.Database.NHibernate/**'
- '**/FeatureManagement.Database.NHibernate.Tests/**'
run_tests:
needs: checks_tests_need
runs-on: ubuntu-latest
strategy:
matrix:
testType: [
{ name: "Abstractions", condition: "abstractions_changed" },
{ name: "CosmosDB", condition: "cosmosdb_changed" },
{ name: "Dapper", condition: "dapper_changed" },
{ name: "EntityFrameworkCore", condition: "efcore_changed" },
{ name: "MongoDB", condition: "mongodb_changed" },
{ name: "NHibernate", condition: "nhibernate_changed" },
]
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
8.0.x
9.0.x
- name: Start CosmosDB Emulator
if: matrix.testType.name == 'CosmosDB' && needs.checks_tests_need.outputs.cosmosdb_changed == 'true'
uses: ./.github/actions/cosmosdb-setup
- name: Run ${{ matrix.testType.name }} tests
if: needs.checks_tests_need.outputs[matrix.testType.condition] == 'true'
shell: pwsh
run: ./test.ps1 -Configuration ${{ env.CONFIGURATION }} -TestType ${{ matrix.testType.name }}