-
-
Notifications
You must be signed in to change notification settings - Fork 28
54 lines (43 loc) · 1.48 KB
/
Copy pathbuildandtest.yml
File metadata and controls
54 lines (43 loc) · 1.48 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
name: Build and Test
on:
workflow_dispatch:
push:
branches: [ dev ]
paths-ignore:
- "**.md"
- "**.ps1"
- ".editorconfig"
- "TestFiles/*"
- '**/*.gitignore'
- '**/*.gitattributes'
- '**/*.yml'
pull_request:
branches: [ main ]
types: [opened, synchronize, reopened, ready_for_review] # Also run when PR is marked ready for review
# Least-privilege GITHUB_TOKEN: this workflow only checks out and builds/tests.
permissions:
contents: read
jobs:
build:
name: Build and Test
runs-on: ubuntu-latest
if: github.event_name != 'push' || github.event.pull_request == null # Prevents duplicate runs
steps:
# uses GitHub's checkout action to checkout code form the release branch
- name: Checkout code
uses: actions/checkout@v6.0.3
# sets up .NET SDK
- name: Setup .NET
uses: actions/setup-dotnet@v5.3.0
with:
global-json-file: ./global.json
- name: Install WASM workload
run: dotnet workload install wasm-tools
- name: Restore dependencies
run: dotnet restore Pkmds.Web/Pkmds.Web.csproj -p:SelfContained=true
- name: Build Web
run: dotnet build Pkmds.Web/Pkmds.Web.csproj --configuration Release --no-restore
- name: Build Functions
run: dotnet build Pkmds.Functions/Pkmds.Functions.csproj --configuration Release
- name: Run tests
run: dotnet test Pkmds.Tests/Pkmds.Tests.csproj --configuration Release