ci: containerize depends jobs

This commit is contained in:
tobtoht
2025-02-08 13:35:58 +01:00
parent 257db6dff2
commit 5b30213057
11 changed files with 93 additions and 36 deletions

View File

@@ -12,9 +12,11 @@ on:
env:
APT_SET_CONF: |
echo "Acquire::Retries \"3\";" | sudo tee -a /etc/apt/apt.conf.d/80-custom
echo "Acquire::http::Timeout \"120\";" | sudo tee -a /etc/apt/apt.conf.d/80-custom
echo "Acquire::ftp::Timeout \"120\";" | sudo tee -a /etc/apt/apt.conf.d/80-custom
tee -a /etc/apt/apt.conf.d/80-custom << EOF
Acquire::Retries "3";
Acquire::http::Timeout "120";
Acquire::ftp::Timeout "120";
EOF
CCACHE_SETTINGS: |
ccache --max-size=150M
ccache --set-config=compression=true
@@ -22,9 +24,12 @@ env:
jobs:
build-cross:
runs-on: ubuntu-20.04
env:
CCACHE_TEMPDIR: /tmp/.ccache-temp
runs-on: ubuntu-latest
container:
image: ubuntu:20.04
env:
DEBIAN_FRONTEND: noninteractive
CCACHE_TEMPDIR: /tmp/.ccache-temp
strategy:
fail-fast: false
matrix:
@@ -48,17 +53,25 @@ jobs:
host: "x86_64-unknown-linux-gnu"
- name: "Cross-Mac x86_64"
host: "x86_64-apple-darwin"
packages: "clang"
- name: "Cross-Mac aarch64"
host: "aarch64-apple-darwin"
host: "arm64-apple-darwin"
packages: "clang"
- name: "x86_64 Freebsd"
host: "x86_64-unknown-freebsd"
packages: "clang-8"
packages: "clang"
- name: "ARMv7 Android"
host: "arm-linux-android"
- name: "ARMv8 Android"
host: "aarch64-linux-android"
name: ${{ matrix.toolchain.name }}
steps:
- name: set apt conf
run: ${{env.APT_SET_CONF}}
- name: install dependencies
run: apt update; apt -y install build-essential libtool cmake autotools-dev automake pkg-config python3 gperf bsdmainutils curl git ca-certificates unzip ccache ${{ matrix.toolchain.packages }}
- name: configure git
run: git config --global --add safe.directory '*'
- uses: actions/checkout@v4
with:
fetch-depth: 0
@@ -79,24 +92,20 @@ jobs:
restore-keys: |
depends-${{ matrix.toolchain.host }}-${{ hashFiles('contrib/depends/packages/*') }}
depends-${{ matrix.toolchain.host }}-
- uses: ./.github/actions/set-make-job-count
- name: set apt conf
run: ${{env.APT_SET_CONF}}
- name: install dependencies
run: sudo apt update; sudo apt -y install build-essential libtool cmake autotools-dev automake pkg-config python3 gperf bsdmainutils curl git ca-certificates ccache ${{ matrix.toolchain.packages }}
- name: prepare w64-mingw32
if: ${{ matrix.toolchain.host == 'x86_64-w64-mingw32' }}
run: |
sudo update-alternatives --set ${{ matrix.toolchain.host }}-g++ $(which ${{ matrix.toolchain.host }}-g++-posix)
sudo update-alternatives --set ${{ matrix.toolchain.host }}-gcc $(which ${{ matrix.toolchain.host }}-gcc-posix)
update-alternatives --set ${{ matrix.toolchain.host }}-g++ $(which ${{ matrix.toolchain.host }}-g++-posix)
update-alternatives --set ${{ matrix.toolchain.host }}-gcc $(which ${{ matrix.toolchain.host }}-gcc-posix)
- uses: ./.github/actions/set-make-job-count
- name: build
run: |
${{env.CCACHE_SETTINGS}}
make depends target=${{ matrix.toolchain.host }} -j${{env.MAKE_JOB_COUNT}}
- uses: actions/upload-artifact@v4
if: ${{ matrix.toolchain.host == 'x86_64-w64-mingw32' || matrix.toolchain.host == 'x86_64-apple-darwin' || matrix.toolchain.host == 'aarch64-apple-darwin' || matrix.toolchain.host == 'x86_64-unknown-linux-gnu' }}
if: ${{ matrix.toolchain.host == 'x86_64-w64-mingw32' || matrix.toolchain.host == 'x86_64-apple-darwin' || matrix.toolchain.host == 'arm64-apple-darwin' || matrix.toolchain.host == 'x86_64-unknown-linux-gnu' }}
with:
name: ${{ matrix.toolchain.name }}
path: |
/home/runner/work/${{ github.event.repository.name }}/${{ github.event.repository.name }}/build/${{ matrix.toolchain.host }}/release/bin/monero-wallet-cli*
/home/runner/work/${{ github.event.repository.name }}/${{ github.event.repository.name }}/build/${{ matrix.toolchain.host }}/release/bin/monerod*
build/${{ matrix.toolchain.host }}/release/bin/monero-wallet-cli*
build/${{ matrix.toolchain.host }}/release/bin/monerod*

View File

@@ -48,7 +48,7 @@ jobs:
- target: "x86_64-w64-mingw32"
- target: "x86_64-unknown-freebsd"
- target: "x86_64-apple-darwin"
- target: "aarch64-apple-darwin"
- target: "arm64-apple-darwin"
- target: "aarch64-linux-android"
name: ${{ matrix.toolchain.target }}