-
Notifications
You must be signed in to change notification settings - Fork 81
98 lines (92 loc) · 3.96 KB
/
ContinuousIntegration.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
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
# Workflow Syntax: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
# Example: https://github.com/github/VisualStudio/blob/263aac11f57d53c5f9fe64ba9916f77c058974d7/.github/workflows/main.yml
# Build and Test (ref. https://docs.github.com/en/actions/guides/building-and-testing-net)
# Note: Github recommends using full commit SHAs when using 3rd party actions
name: Continuous Integration
concurrency:
group: ${{ github.workflow }}-${{ github.sha }}
cancel-in-progress: true
env:
build-config: Release
solution: EDDI.sln
# Build artifact variables
build-artifact-name: build-artifact
# Define our triggers
on:
push:
branches:
- '*'
- develop
- '!l10n_develop'
- '!refs/pull/*'
paths-ignore:
- docs/* # Every file in the root docs folder
- '**.html' # HTML files anywhere in the repo
- '**.md' # Markdown files anywhere in the repo
- '**.resx' # RESX files anywhere in the repo
pull_request:
# The branches below must be a subset of the branches above
branches:
- develop
paths-ignore:
- docs/* # Every file in the root docs folder
- '**.html' # HTML files anywhere in the repo
- '**.md' # Markdown files anywhere in the repo
- '**.resx' # RESX files anywhere in the repo
schedule:
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
# │ │ │ │ │ * indicates 'all'
# │ │ │ │ │ Ref. https://docs.github.com/en/actions/reference/events-that-trigger-workflows#schedule
# │ │ │ │ │
# * * * * *
- cron: '30 2 * * 0' # Runs at 2:30 AM UTC, any day of the month, any month of the year, on Sundays
jobs:
build:
name: Build & Test
runs-on: windows-latest
steps:
- name: Check out the repository on the workflow runner
uses: actions/[email protected]
# Build
- name: Add msbuild.exe to PATH
uses: microsoft/[email protected]
- name: Add nuget to PATH
uses: nuget/setup-nuget@fd9fffd6ca4541cf4152a9565835ca1a88a6eb37
with:
nuget-version: 'latest'
- name: Retrieve any cached copies of dependencies (these may be stored for up to a week)
uses: actions/cache@main
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }} #hash of project files with embedded PackageReference data
restore-keys: |
${{ runner.os }}-nuget
- name: Restore any missing dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: nuget restore ${{ env.solution }} -NonInteractive
- name: Save our updated cache of dependencies
if: steps.cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v3
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }} #hash of project files with embedded PackageReference data
- name: Build our solution
id: build
run: msbuild ${{ env.solution }} /p:Configuration=${{ env.build-config }} /p:UseSharedCompilation=false /verbosity:minimal
- name: Upload build artifacts
uses: actions/[email protected]
with:
name: ${{ env.build-artifact-name }}
path: ./bin/Release/*
# Perform unit testing
- name: Add VSTest.console.exe to PATH
uses: darenm/Setup-VSTest@d9a5dffa3f11d9c27ec42eb69515d3aaeaad9ef8
- name: Test our solution
uses: ./.github/actions/Test
with:
target-path: vstest.console.exe
target-args: Tests\bin\Release\Tests.dll /tests:UnitTests /Parallel /InIsolation /Blame