12
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
17
name: Check for changes
18
runs-on: ubuntu-latest # don't need matrix to test where the changes were made in code
23
tsavorite: ${{ steps.filter.outputs.tsavorite }}
24
website: ${{ steps.filter.outputs.website }}
25
garnet: ${{ steps.filter.outputs.garnet }}
27
- name: Check out code
28
uses: actions/checkout@v4
30
uses: dorny/paths-filter@v3
35
- 'libs/storage/Tsavorite/**'
39
- '!((*.md)|(website/**))'
44
runs-on: ubuntu-latest
45
if: needs.changes.outputs.garnet == 'true'
47
- name: Check out code
48
uses: actions/checkout@v4
50
uses: actions/setup-dotnet@v4
53
- name: Install dependencies
54
run: dotnet restore Garnet.sln
55
- name: Check style format
56
run: dotnet format Garnet.sln --no-restore --verify-no-changes --verbosity diagnostic
59
name: Format Tsavorite
61
runs-on: ubuntu-latest
62
if: needs.changes.outputs.tsavorite == 'true'
64
- name: Check out code
65
uses: actions/checkout@v4
67
uses: actions/setup-dotnet@v4
70
- name: Install dependencies
71
run: dotnet restore libs/storage/Tsavorite/cs/Tsavorite.sln
72
- name: Check style format
73
run: dotnet format libs/storage/Tsavorite/cs/Tsavorite.sln --no-restore --verify-no-changes --verbosity diagnostic
75
# Job to build and test Garnet code
78
needs: [changes, format-garnet]
79
runs-on: ${{ matrix.os }}
83
os: [ ubuntu-latest, windows-latest ]
84
framework: [ 'net6.0', 'net8.0' ]
85
configuration: [ 'Debug', 'Release' ]
86
test: [ 'Garnet.test', 'Garnet.test.cluster' ]
87
if: needs.changes.outputs.garnet == 'true'
89
- name: Check out code
90
uses: actions/checkout@v4
92
uses: actions/setup-dotnet@v4
95
- name: Install dependencies
98
run: dotnet build --configuration ${{ matrix.configuration }}
99
- name: Run tests ${{ matrix.test }}
100
run: dotnet test test/${{ matrix.test }} -f ${{ matrix.framework }} --configuration ${{ matrix.configuration }} --logger "console;verbosity=detailed" --logger trx --results-directory "GarnetTestResults-${{ matrix.os }}-${{ matrix.framework }}-${{ matrix.configuration }}-${{ matrix.test }}"
102
- name: Upload test results
103
uses: actions/upload-artifact@v4
105
name: dotnet-garnet-results-${{ matrix.os }}-${{ matrix.framework }}-${{ matrix.configuration }}-${{ matrix.test }}
106
path: GarnetTestResults-${{ matrix.os }}-${{ matrix.framework }}-${{ matrix.configuration }}-${{ matrix.test }}
109
# Job to build and test Tsavorite code (only if there were changes to it)
110
build-test-tsavorite:
112
needs: [changes, format-tsavorite]
113
runs-on: ${{ matrix.os }}
117
os: [ ubuntu-latest, windows-latest ]
118
framework: [ 'net6.0', 'net8.0' ]
119
configuration: [ 'Debug', 'Release' ]
120
if: needs.changes.outputs.tsavorite == 'true'
122
- name: Check out code
123
uses: actions/checkout@v4
124
- name: Set environment variable for Linux
125
run: echo "RunAzureTests=yes" >> $GITHUB_ENV
126
if: ${{ matrix.os == 'ubuntu-latest' }}
127
- name: Set environment variable for Windows
128
run: echo ("RunAzureTests=yes") >> $env:GITHUB_ENV
129
if: ${{ matrix.os == 'windows-latest' }}
131
uses: actions/setup-dotnet@v4
133
dotnet-version: 8.0.x
134
- name: Setup Node.js for Azurite
135
uses: actions/setup-node@v4
138
- name: Install and Run Azurite
141
npm install -g azurite
143
- name: Install dependencies
145
- name: Build Tsavorite
146
run: dotnet build libs/storage/Tsavorite/cs/test/Tsavorite.test.csproj --configuration ${{ matrix.configuration }}
147
- name: Run Tsavorite tests
148
run: dotnet test libs/storage/Tsavorite/cs/test/Tsavorite.test.csproj -f ${{ matrix.framework }} --configuration ${{ matrix.configuration }} --logger "console;verbosity=detailed" --logger trx --results-directory "TsavoriteTestResults-${{ matrix.os }}-${{ matrix.framework }}-${{ matrix.configuration }}"
150
- name: Upload test results
151
uses: actions/upload-artifact@v4
153
name: dotnet-tsavorite-results-${{ matrix.os }}-${{ matrix.framework }}-${{ matrix.configuration }}
154
path: TsavoriteTestResults-${{ matrix.os }}-${{ matrix.framework }}-${{ matrix.configuration }}
160
runs-on: ubuntu-latest
163
working-directory: website
164
if: needs.changes.outputs.website == 'true'
166
- uses: actions/checkout@v3
167
- uses: actions/setup-node@v3
171
cache-dependency-path: ./website/yarn.lock
172
- name: Install dependencies
173
run: yarn install --frozen-lockfile
174
- name: Build website
178
name: Garnet CI (Complete)
179
runs-on: ubuntu-latest
180
needs: [ build-test-garnet, build-test-tsavorite, build-website ]
183
if: ${{ !(failure() || cancelled()) }}