-
Notifications
You must be signed in to change notification settings - Fork 77
99 lines (85 loc) · 3 KB
/
ci-matrix.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
99
name: CI
on:
push:
branches:
- main
- release/*
pull_request:
branches:
- main
- release/*
workflow_dispatch:
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_NOLOGO: 1
UNITY_HASH: '887be4894c44'
UNITY_FULL_VERSION: '2022.3.22f1'
jobs:
compute:
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
deployments: read
packages: none
pull-requests: write
security-events: write
outputs:
UNITY_HASH: ${{ env.UNITY_HASH }}
UNITY_FULL_VERSION: ${{ env.UNITY_FULL_VERSION }}
steps:
- name: Compute outputs
run: |
echo "UNITY_HASH=${{ env.UNITY_HASH }}" >> $GITHUB_OUTPUT
echo "UNITY_FULL_VERSION=${{ env.UNITY_FULL_VERSION }}" >> $GITHUB_OUTPUT
ci:
strategy:
matrix:
include:
- os: ubuntu
download: curl -o ./Unity.tar.xz -k https://download.unity3d.com/download_unity/${{ needs.compute.outputs.UNITY_HASH }}/LinuxEditorInstaller/Unity.tar.xz
install: mkdir -p ~/Unity && tar -xf Unity.tar.xz -C ~/Unity
- os: macos
download: curl -o ./unity.pkg -k https://download.unity3d.com/download_unity/${{ needs.compute.outputs.UNITY_HASH }}/MacEditorInstaller/Unity.pkg
install: sudo installer -package unity.pkg -target /
- os: windows
download: cmd /c bitsadmin /TRANSFER unity /DOWNLOAD /PRIORITY foreground "https://download.unity3d.com/download_unity/${{ needs.compute.outputs.UNITY_HASH }}/Windows64EditorInstaller/UnitySetup64-${{ needs.compute.outputs.UNITY_FULL_VERSION }}.exe" "%CD%\unitysetup.exe"
install: cmd /c unitysetup.exe /UI=reduced /S /D=%ProgramFiles%\Unity
name: CI-${{ matrix.os }}
runs-on: ${{ matrix.os }}-latest
needs: compute
permissions:
actions: read
contents: read
deployments: read
packages: none
pull-requests: write
security-events: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Download Unity on ${{ matrix.os }}
run: ${{ matrix.download }}
- name: Install Unity on ${{ matrix.os }}
run: ${{ matrix.install }}
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
- name: Build
run: dotnet build -c Debug ./src/Microsoft.Unity.Analyzers.sln /p:UseSharedCompilation=false
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
- name: Test context (main)
if: github.ref == 'refs/heads/main'
run: echo "TEST_FILTER=." >> $GITHUB_ENV
shell: bash
- name: Test context (feature)
if: github.ref != 'refs/heads/main'
run: echo "TEST_FILTER=FullyQualifiedName!~ConsistencyTests" >> $GITHUB_ENV
shell: bash
- name: Test
run: dotnet test -c Debug ./src/Microsoft.Unity.Analyzers.Tests --filter ${{env.TEST_FILTER}}
shell: bash