Free up space #154
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: | |
- '**' | |
jobs: | |
native-build: | |
name: 'Native build' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@main | |
with: | |
submodules: true | |
- name: Check for cache | |
id: check-cache | |
uses: actions/cache@main | |
with: | |
key: gcc-15.0.1-2 | |
lookup-only: true | |
path: | | |
/tmp/x86_64-linux-gnu.tar.xz | |
/tmp/x86_64-linux-gnu.tar.xz.sha256 | |
- name: Build Dakini | |
if: ${{ steps.check-cache.outputs.cache-hit != 'true' }} | |
run: | | |
bash './build.sh' 'native' | |
- name: Generate tarball | |
if: ${{ steps.check-cache.outputs.cache-hit != 'true' }} | |
run: | | |
declare tarball_filename='/tmp/x86_64-linux-gnu.tar.xz' | |
tar --directory='/tmp' --create --file=- 'dakini' | xz --threads='0' --compress -9 > "${tarball_filename}" | |
sha256sum "${tarball_filename}" | sed 's|/tmp/||' > "${tarball_filename}.sha256" | |
- name: Upload artifact | |
if: ${{ steps.check-cache.outputs.cache-hit != 'true' }} | |
uses: actions/upload-artifact@main | |
with: | |
name: native-toolchain | |
if-no-files-found: error | |
path: | | |
/tmp/x86_64-linux-gnu.tar.xz | |
/tmp/x86_64-linux-gnu.tar.xz.sha256 | |
- name: Cache artifact | |
if: ${{ steps.check-cache.outputs.cache-hit != 'true' }} | |
uses: actions/cache@main | |
with: | |
key: gcc-15.0.1-2 | |
path: | | |
/tmp/x86_64-linux-gnu.tar.xz | |
/tmp/x86_64-linux-gnu.tar.xz.sha256 | |
cross-build: | |
name: 'Cross build' | |
needs: native-build | |
runs-on: ubuntu-latest | |
continue-on-error: true | |
strategy: | |
matrix: | |
target: [ | |
'ia64-unknown-linux-gnu', | |
'alpha-unknown-linux-gnu', | |
'x86_64-unknown-linux-gnu', | |
'i386-unknown-linux-gnu', | |
'arm-unknown-linux-gnueabi', | |
'arm-unknown-linux-gnueabihf', | |
'hppa-unknown-linux-gnu', | |
'aarch64-unknown-linux-gnu', | |
'mips-unknown-linux-gnu', | |
'mipsel-unknown-linux-gnu', | |
'powerpc-unknown-linux-gnu', | |
's390-unknown-linux-gnu', | |
's390x-unknown-linux-gnu', | |
'sparc-unknown-linux-gnu', | |
'powerpc64le-unknown-linux-gnu', | |
'mips64el-unknown-linux-gnuabi64' | |
] | |
steps: | |
- uses: actions/checkout@main | |
with: | |
submodules: true | |
- name: Free up some space | |
run: | | |
sudo apt purge --allow-remove-essential --auto-remove \ | |
'*apache2*' \ | |
'*docker*' \ | |
'*dotnet*' \ | |
'*firefox*' \ | |
'*google*' \ | |
'*gstreamer*' \ | |
'*jdk*' \ | |
'*nginx*' \ | |
'*php*' \ | |
'*ruby*' \ | |
'*wayland*' \ | |
'auto*' \ | |
'azure-cli' \ | |
'bind9*' \ | |
'binutils*' \ | |
'build-essential' \ | |
'clang*' \ | |
'container*' \ | |
'fonts*' \ | |
'gcc-9' \ | |
'gcc-10' \ | |
'gcc-11' \ | |
'gcc-12' \ | |
'gh' \ | |
'glib*' \ | |
'libmono*' \ | |
'lld*' \ | |
'llvm*' \ | |
'mercurial*' \ | |
'mysql*' \ | |
'postgresql*' \ | |
'powershell' \ | |
'vim*' \ | |
'x11*' \ | |
'xdg*' > '/dev/null' | |
sudo rm --recursive --force \ | |
"${HOME}/.cargo" \ | |
"${HOME}/.rustup" \ | |
"${HOME}/linuxbrew" \ | |
'/etc/cni/net.d' \ | |
'/etc/docker' \ | |
'/etc/mono' \ | |
'/etc/mysql' \ | |
'/lib/tmpfiles.d' \ | |
'/opt/'* \ | |
'/opt/az' \ | |
'/usr/lib/heroku' \ | |
'/usr/lib/mono' \ | |
'/usr/libexec/docker' \ | |
'/usr/local/lib/android' \ | |
'/usr/local/lib/android' \ | |
'/usr/local/share/man' \ | |
'/usr/local/share/vcpkg' \ | |
'/usr/share/fonts' \ | |
'/usr/share/icons' \ | |
'/usr/share/java' \ | |
'/usr/share/php' \ | |
'/usr/share/swift' \ | |
'/var/lib/apache2' \ | |
'/var/lib/gems' \ | |
'/var/log' | |
- name: Install required dependencies | |
sudo apt-get install build-essential | |
run: | | |
- name: Restore from cache | |
uses: actions/cache@main | |
with: | |
key: gcc-15.0.1-2 | |
fail-on-cache-miss: true | |
path: | | |
/tmp/x86_64-linux-gnu.tar.xz | |
/tmp/x86_64-linux-gnu.tar.xz.sha256 | |
- name: Setup toolchain | |
run: | | |
tar --directory='/tmp' --extract --file='/tmp/x86_64-linux-gnu.tar.xz' | |
mv '/tmp/dakini' '/tmp/dakini-toolchain' | |
- name: Build Dakini with OBGGCC | |
run: | | |
source './tools/setup_toolchain.sh' | |
source './submodules/obggcc/tools/setup_toolchain.sh' | |
bash './build.sh' '${{ matrix.target }}' | |
- name: Generate tarball | |
run: | | |
declare tarball_filename='/tmp/${{ matrix.target }}.tar.xz' | |
tar --directory='/tmp' --create --file=- 'dakini' | xz --threads='0' --compress -9 > "${tarball_filename}" | |
sha256sum "${tarball_filename}" | sed 's|/tmp/||' > "${tarball_filename}.sha256" | |
- name: Upload artifact | |
uses: actions/upload-artifact@main | |
with: | |
name: ${{ matrix.target }} | |
if-no-files-found: error | |
path: | | |
/tmp/${{ matrix.target }}.tar.xz | |
/tmp/${{ matrix.target }}.tar.xz.sha256 |