Skip to content

Commit cc47fb5

Browse files
authored
Merge pull request #1304 from dorssel/nuget_cache
Refactor NuGet cache
2 parents 4806940 + 16f5893 commit cc47fb5

File tree

3 files changed

+16
-62
lines changed

3 files changed

+16
-62
lines changed

.github/workflows/build-installer.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,14 @@ jobs:
3333
with:
3434
fetch-depth: 0
3535

36-
- name: NuGet Cache
37-
uses: actions/cache@v4
38-
with:
39-
path: |
40-
${{ github.workspace }}/.nuget/packages
41-
key: nuget-cache-build-${{ hashFiles('global.json', '.config/dotnet-tools.json', '**/packages.lock.json') }}
42-
4336
- name: Setup .NET
4437
uses: actions/setup-dotnet@v5
38+
with:
39+
cache: true
40+
cache-dependency-path: |
41+
global.json
42+
.config/dotnet-tools.json
43+
'**/packages.lock.json'
4544
4645
- name: Install dependencies
4746
run: |

.github/workflows/codeql-analysis.yml

Lines changed: 10 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,12 @@
55
---
66
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
77

8-
# For most projects, this workflow file will not need changing; you simply need
9-
# to commit it to your repository.
10-
#
11-
# You may wish to alter this file to override the set of languages analyzed,
12-
# or to provide custom queries or build logic.
13-
#
14-
# ******** NOTE ********
15-
# We have attempted to detect the languages in your repository. Please check
16-
# the `language` matrix defined below to confirm you have the correct set of
17-
# supported CodeQL languages.
18-
# ******** NOTE ********
19-
208
name: CodeQL
219

2210
on:
2311
push:
2412
branches: [master]
2513
pull_request:
26-
# The branches below must be a subset of the branches above
2714
branches: [master]
2815
schedule:
2916
- cron: '20 0 * * 4'
@@ -33,19 +20,11 @@ permissions: read-all
3320
jobs:
3421
analyze:
3522
name: Analyze
36-
runs-on: ubuntu-latest
23+
runs-on: windows-latest
3724

3825
permissions:
3926
security-events: write
4027

41-
strategy:
42-
fail-fast: false
43-
matrix:
44-
language: [csharp]
45-
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
46-
# Learn more...
47-
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
48-
4928
env:
5029
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
5130
DOTNET_CLI_WORKLOAD_UPDATE_NOTIFY_DISABLE: true
@@ -56,49 +35,28 @@ jobs:
5635
with:
5736
fetch-depth: 0
5837

59-
# Initializes the CodeQL tools for scanning.
6038
- name: Initialize CodeQL
6139
uses: github/codeql-action/init@v4
6240
with:
63-
languages: ${{ matrix.language }}
64-
# If you wish to specify custom queries, you can do so here or in a config file.
65-
# By default, queries listed here will override any specified in a config file.
66-
# Prefix the list here with "+" to use these queries and those in the config file.
67-
# queries: ./path/to/local/query, your-org/your-repo/queries@main
68-
69-
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
70-
# If this step fails, then you should remove it and run the build manually (see below)
71-
# - name: Autobuild
72-
# uses: github/codeql-action/autobuild@v3
73-
74-
# ℹ️ Command-line programs to run using the OS shell.
75-
# 📚 https://git.io/JvXDl
76-
77-
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
78-
# and modify them (or add more) to build your code if your project
79-
# uses a compiled language
80-
81-
# - run: |
82-
# make bootstrap
83-
# make release
84-
85-
- name: NuGet Cache
86-
uses: actions/cache@v4
87-
with:
88-
path: |
89-
${{ github.workspace }}/.nuget/packages
90-
key: nuget-cache-codeql-${{ hashFiles('global.json', '.config/dotnet-tools.json', '**/packages.lock.json') }}
41+
languages: csharp
9142

9243
- name: Setup .NET
9344
uses: actions/setup-dotnet@v5
45+
with:
46+
cache: true
47+
cache-dependency-path: |
48+
global.json
49+
.config/dotnet-tools.json
50+
'**/packages.lock.json'
9451
9552
- name: Install dependencies
9653
run: |
9754
dotnet tool restore
9855
dotnet restore
9956
10057
- name: Build
101-
run: dotnet build --configuration Release --no-restore --property:Platform=x64
58+
run: |
59+
dotnet build --configuration Release --no-restore --property:Platform=x64
10260
10361
- name: Perform CodeQL Analysis
10462
uses: github/codeql-action/analyze@v4

Directory.Build.props

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ SPDX-License-Identifier: GPL-3.0-only
1717
<Nullable>enable</Nullable>
1818
<ImplicitUsings>enable</ImplicitUsings>
1919

20-
<!-- This allows building on Linux; however, building the installer requires Windows -->
21-
<EnableWindowsTargeting>true</EnableWindowsTargeting>
22-
2320
<!-- Be very strict -->
2421
<WarningLevel>9999</WarningLevel>
2522
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>

0 commit comments

Comments
 (0)