-
Notifications
You must be signed in to change notification settings - Fork 1
52 lines (48 loc) · 1.61 KB
/
dotnet.yml
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
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: .NET
on:
workflow_dispatch:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
name: 🛠️ Build and Test Release 🛠️
runs-on: ubuntu-latest
steps:
- name: Clear cache
uses: actions/github-script@v6
with:
script: |
console.log("About to clear")
const caches = await github.rest.actions.getActionsCacheList({
owner: context.repo.owner,
repo: context.repo.repo,
})
for (const cache of caches.data.actions_caches) {
console.log(cache)
github.rest.actions.deleteActionsCacheById({
owner: context.repo.owner,
repo: context.repo.repo,
cache_id: cache.id,
})
}
console.log("Clear completed")
- name: 🛠️ Check-out code
uses: actions/checkout@v3
- name: 🛠️ Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 9.x
- name: 🛠️ Enable Problem Matchers
run: echo "::add-matcher::.github/matchers/dotnet.json"
- name: 🛠️ Restore & Load Dependencies
# Eventually add in cache for packages
run: dotnet restore
- name: 🛠️ Build Release
# Test pipeline as production Release
run: dotnet build --configuration Release --no-restore
- name: 🛠️ Test Release
run: dotnet test --no-build --verbosity normal