Skip to content

Commit 91ffd74

Browse files
committed
Simplify GHA CI workflow
1 parent 40d40fb commit 91ffd74

File tree

1 file changed

+7
-21
lines changed

1 file changed

+7
-21
lines changed

.github/workflows/main.yml

+7-21
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,19 @@ jobs:
4848
- os: ubuntu-latest
4949
env:
5050
TARGET_TRIPLE: x86_64-pc-windows-gnu
51+
apt_deps: gcc-mingw-w64-x86-64 wine-stable
5152
- os: ubuntu-latest
5253
env:
5354
TARGET_TRIPLE: aarch64-unknown-linux-gnu
55+
apt_deps: gcc-aarch64-linux-gnu qemu-user
5456
- os: ubuntu-latest
5557
env:
5658
TARGET_TRIPLE: s390x-unknown-linux-gnu
59+
apt_deps: gcc-s390x-linux-gnu qemu-user
5760
- os: ubuntu-latest
5861
env:
5962
TARGET_TRIPLE: riscv64gc-unknown-linux-gnu
63+
apt_deps: gcc-riscv64-linux-gnu qemu-user
6064
- os: windows-latest
6165
env:
6266
TARGET_TRIPLE: x86_64-pc-windows-msvc
@@ -81,29 +85,11 @@ jobs:
8185
if: matrix.os == 'windows-latest' && matrix.env.TARGET_TRIPLE == 'x86_64-pc-windows-gnu'
8286
run: rustup set default-host x86_64-pc-windows-gnu
8387

84-
- name: Install MinGW toolchain and wine
85-
if: matrix.os == 'ubuntu-latest' && matrix.env.TARGET_TRIPLE == 'x86_64-pc-windows-gnu'
86-
run: |
87-
sudo apt-get update
88-
sudo apt-get install -y gcc-mingw-w64-x86-64 wine-stable
89-
90-
- name: Install AArch64 toolchain and qemu
91-
if: matrix.os == 'ubuntu-latest' && matrix.env.TARGET_TRIPLE == 'aarch64-unknown-linux-gnu'
92-
run: |
93-
sudo apt-get update
94-
sudo apt-get install -y gcc-aarch64-linux-gnu qemu-user
95-
96-
- name: Install s390x toolchain and qemu
97-
if: matrix.env.TARGET_TRIPLE == 's390x-unknown-linux-gnu'
98-
run: |
99-
sudo apt-get update
100-
sudo apt-get install -y gcc-s390x-linux-gnu qemu-user
101-
102-
- name: Install riscv64gc toolchain and qemu
103-
if: matrix.env.TARGET_TRIPLE == 'riscv64gc-unknown-linux-gnu'
88+
- name: Install toolchain and emulator
89+
if: matrix.apt_deps != null
10490
run: |
10591
sudo apt-get update
106-
sudo apt-get install -y gcc-riscv64-linux-gnu qemu-user
92+
sudo apt-get install -y ${{ matrix.apt_deps }}
10793
10894
- name: Prepare dependencies
10995
run: ./y.sh prepare

0 commit comments

Comments
 (0)