Skip to content

Commit 0c8b3f3

Browse files
committed
[CI] Combine test and dependency installation tasks into one
1 parent 33a0fec commit 0c8b3f3

File tree

1 file changed

+29
-57
lines changed

1 file changed

+29
-57
lines changed

.github/workflows/main.yml

Lines changed: 29 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -42,79 +42,51 @@ jobs:
4242
version: 1.3.283.0
4343
cache: true
4444

45-
- name: Disable annotations
45+
- name: Disable Annotations
4646
run: echo "::remove-matcher owner=csc::"
4747

48-
- name: install wine64 on linux
49-
run: |
50-
sudo apt install p7zip-full curl
51-
sudo dpkg --add-architecture i386
52-
sudo mkdir -pm755 /etc/apt/keyrings
53-
sudo wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key
54-
sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/jammy/winehq-jammy.sources
55-
sudo apt update && sudo apt install --install-recommends winehq-stable
56-
if: runner.os == 'Linux'
57-
58-
- name: Install Arial Font
59-
run: |
60-
echo "ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true" | sudo debconf-set-selections
61-
sudo apt install -y ttf-mscorefonts-installer
62-
sudo fc-cache
63-
fc-match Arial
64-
if: runner.os == 'Linux'
65-
66-
- name: install wine64 on macos
67-
run: |
68-
brew install wine-stable p7zip freeimage freetype
69-
sudo mkdir -p /usr/local/lib
70-
sudo ln -s /opt/homebrew/lib/libfreetype.dylib /usr/local/lib/libfreetype6.dylib
71-
sudo ln -s /opt/homebrew/lib/libfreeimage.dylib /usr/local/lib/libfreeimage.dylib
72-
if: runner.os == 'macOS'
73-
74-
- name: Setup Wine
75-
run: wget -qO- https://monogame.net/downloads/net9_mgfxc_wine_setup.sh | bash
76-
if: runner.os != 'Windows'
77-
78-
- uses: maxim-lobanov/setup-xcode@v1
79-
with:
80-
xcode-version: latest-stable
81-
if: runner.os == 'macOS'
82-
83-
- name: Install required workloads
48+
- name: Install Dependencies
8449
run: |
8550
if [ "$RUNNER_OS" == "Linux" ]; then
8651
dotnet workload install android --version 8.0.402.0
52+
sudo apt install p7zip-full curl
53+
sudo dpkg --add-architecture i386
54+
sudo mkdir -pm755 /etc/apt/keyrings
55+
sudo wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key
56+
sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/jammy/winehq-jammy.sources
57+
sudo apt update && sudo apt install --install-recommends winehq-stable
58+
echo "ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true" | sudo debconf-set-selections
59+
sudo apt install -y ttf-mscorefonts-installer
60+
sudo fc-cache
61+
fc-match Arial
62+
run: wget -qO- https://monogame.net/downloads/net9_mgfxc_wine_setup.sh | bash
8763
elif [ "$RUNNER_OS" == "Windows" ]; then
88-
dotnet.exe workload install android ios macos
64+
dotnet.exe workload install android ios macos --version 8.0.402.0
8965
else
9066
dotnet workload install android macos ios --version 8.0.402.0
67+
brew install wine-stable p7zip freeimage freetype
68+
sudo mkdir -p /usr/local/lib
69+
sudo ln -s /opt/homebrew/lib/libfreetype.dylib /usr/local/lib/libfreetype6.dylib
70+
sudo ln -s /opt/homebrew/lib/libfreeimage.dylib /usr/local/lib/libfreeimage.dylib
71+
run: wget -qO- https://monogame.net/downloads/net9_mgfxc_wine_setup.sh | bash
9172
fi
9273
shell: bash
9374

9475
- name: Build
9576
run: dotnet run --project build/Build.csproj -- --target=Default
9677

97-
- name: Test
98-
run: dotnet test Tools/MonoGame.Tools.Tests/MonoGame.Tools.Tests.csproj --blame-hang-timeout 5m -c Release --filter="TestCategory!=Audio"
99-
env:
100-
DOTNET_ROOT: ${{github.workspace}}/dotnet64
101-
MGFXC_WINE_PATH: /home/runner/.winemonogame
102-
CI: true
103-
if: runner.os == 'Linux'
104-
105-
- name: Test
106-
run: dotnet test Tools/MonoGame.Tools.Tests/MonoGame.Tools.Tests.csproj --blame-hang-timeout 5m -c Release --filter="TestCategory!=Audio"
107-
env:
108-
DOTNET_ROOT: ${{github.workspace}}/dotnet64
109-
MGFXC_WINE_PATH: /Users/runner/.winemonogame
110-
CI: true
111-
if: runner.os == 'macOS'
112-
113-
- name: Test
114-
run: dotnet test Tools/MonoGame.Tools.Tests/MonoGame.Tools.Tests.csproj --blame-hang-timeout 5m -c Release
78+
- name: Run Tests
79+
run: |
80+
if [ "$RUNNER_OS" == "Windows" ]; then
81+
dotnet test Tools/MonoGame.Tools.Tests/MonoGame.Tools.Tests.csproj --blame-hang-timeout 5m -c Release
82+
elif [ "$RUNNER_OS" == "Linux" ]; then
83+
MGFXC_WINE_PATH=/home/runner/.winemonogame dotnet test Tools/MonoGame.Tools.Tests/MonoGame.Tools.Tests.csproj --blame-hang-timeout 5m -c Release --filter="TestCategory!=Audio"
84+
else
85+
MGFXC_WINE_PATH=/Users/runner/.winemonogame dotnet test Tools/MonoGame.Tools.Tests/MonoGame.Tools.Tests.csproj --blame-hang-timeout 5m -c Release --filter="TestCategory!=Audio"
86+
fi
11587
env:
11688
CI: true
117-
if: runner.os == 'Windows'
89+
shell: bash
11890

11991
- name: Expose GitHub Runtime
12092
uses: crazy-max/ghaction-github-runtime@v3

0 commit comments

Comments
 (0)