CogVM source as per VMMaker.oscog-eem.3478 #483
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 for Linux (ARM) | |
on: | |
push: # All branches, but appropriate paths only. | |
paths: | |
# This workflow spec and its support scripts | |
- '.github/workflows/linux-arm.yml' | |
- 'scripts/ci/*linux_arm.sh' | |
- 'scripts/ci/*build.sh' | |
- 'deploy/**' | |
# Relevant sources for this platform | |
- 'building/linux*ARM*/**' # Makefile-based build scripts | |
- 'building/linux32/**' # Makefile-based build scripts | |
- 'building/linux64/**' # Makefile-based build scripts | |
- '*src/**' # Generated VMMaker sources (incl. plugins) | |
- 'platforms/Cross/**' | |
- 'platforms/unix/**' | |
# Skip changes in documentation artifacts | |
- '!**.md' | |
- '!**HowToBuild' | |
pull_request: | |
branches: | |
- Cog | |
paths: | |
# This workflow spec and its support scripts | |
- '.github/workflows/linux-arm.yml' | |
- 'scripts/ci/*linux_arm.sh' | |
- 'scripts/ci/*build.sh' | |
- 'deploy/**' | |
# Relevant sources for this platform | |
- 'building/linux*ARM*/**' # Makefile-based build scripts | |
- 'building/linux32/**' # Makefile-based build scripts | |
- 'building/linux64/**' # Makefile-based build scripts | |
- '*src/**' # Generated VMMaker sources (incl. plugins) | |
- 'platforms/Cross/**' | |
- 'platforms/unix/**' | |
# Skip changes in documentation artifacts | |
- '!**.md' | |
- '!**HowToBuild' | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: "Build new release candidate for tag" | |
required: true | |
default: YYYYMMDDHHMM | |
jobs: | |
build: | |
strategy: | |
fail-fast: false # let them finish bc. mixed platforms | |
matrix: | |
arch: | |
- linux32ARMv6 | |
# - linux32ARMv7 # Newspeak only, see "extra-arm" workflow | |
- linux64ARMv8 | |
flavor: | |
- squeak.cog.spur | |
- squeak.stack.spur | |
mode: | |
- fast | |
- debug | |
- assert | |
runs-on: ubuntu-latest # we setup QEMU to produce binaries anyway | |
name: ${{ matrix.flavor }} for ${{ matrix.arch }}${{ matrix.mode == 'debug' && ' (DEBUG)' || matrix.mode == 'assert' && ' (ASSERT)' || '' }} | |
env: | |
ARCH: ${{ matrix.arch }} | |
ARCH_ARM: ${{ matrix.arch == 'linux32ARMv6' && 'armv6' || matrix.arch == 'linux32ARMv7' && 'armv7' || 'aarch64' }} | |
FLAVOR: ${{ matrix.flavor }} | |
MODE: ${{ matrix.mode }} | |
HEARTBEAT: threaded # itimer not supported | |
steps: | |
- name: Checkout files | |
if: github.event_name != 'workflow_dispatch' | |
uses: actions/checkout@v3 | |
- name: Checkout files for new release candidate | |
if: github.event_name == 'workflow_dispatch' | |
uses: actions/checkout@v3 | |
with: | |
ref: refs/tags/${{ github.event.inputs.tag }} | |
# TODO: Can we use the same thirdparty cache for armv6, armv7, and aarch64? Are pre-compiled binaries compatible or organized differently? | |
- name: Restore build cache | |
uses: actions/cache@v3 | |
with: | |
path: .thirdparty-cache | |
key: thirdparty-cache-${{ matrix.arch }}-${{ matrix.flavor }} | |
# https://github.com/marketplace/actions/run-on-architecture | |
- name: Build VM | |
uses: uraimo/run-on-arch-action@v2 | |
id: build-vm | |
with: | |
arch: ${{ env.ARCH_ARM }} | |
distro: buster | |
#TODO: Somehow use ./scripts/ci/actions_prepare_linux_arm.sh | |
#SEE: https://github.com/uraimo/run-on-arch-action/issues/54 | |
install: | | |
apt update -y | |
apt install -yq --no-install-suggests --no-install-recommends build-essential git devscripts uuid-dev libcairo2-dev libpango1.0-dev libgl1-mesa-dev libgl1-mesa-glx libssl-dev libevdev-dev m4 libpulse-dev libasound2-dev libfreetype6-dev libx11-dev libxrender-dev libxrandr-dev libtool automake autoconf libltdl-dev | |
git config --global --add safe.directory ${{ github.workspace }} | |
env: | # Copy the entire environment for the docker container | |
ARCH: ${{ env.ARCH }} | |
ARCH_ARM: ${{ env.ARCH_ARM }} | |
FLAVOR: ${{ env.FLAVOR }} | |
MODE: ${{ env.MODE }} | |
HEARTBEAT: ${{ env.HEARTBEAT }} | |
run: ./scripts/ci/actions_build.sh | |
- name: Post Build VM | |
#TODO: https://github.com/uraimo/run-on-arch-action/issues/52 | |
run: | | |
sudo chown -R runner ${{ steps.build-vm.outputs.PRODUCTS_PATH }} | |
echo "ASSET_REVISION=${{ steps.build-vm.outputs.ASSET_REVISION }}" >> $GITHUB_ENV | |
echo "ASSET_NAME=${{ steps.build-vm.outputs.ASSET_NAME }}" >> $GITHUB_ENV | |
echo "PRODUCTS_PATH=${{ steps.build-vm.outputs.PRODUCTS_PATH }}" >> $GITHUB_ENV | |
echo "APP_NAME=${{ steps.build-vm.outputs.APP_NAME }}" >> $GITHUB_ENV | |
- name: Sign VM (not implemented) | |
if: false | |
run: ./deploy/sign-vm.sh | |
- name: Pack VM | |
run: ./deploy/pack-vm.sh | |
- name: Store artifact w/ revision | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.ASSET_NAME }}_${{ env.ASSET_REVISION }} | |
path: ${{ env.PRODUCTS_PATH }}/${{ env.ASSET_NAME }}.${{ env.ASSET_EXTENSION }} | |
- name: Update artifact in latest-release | |
uses: ncipollo/release-action@v1 | |
if: github.event_name == 'push' && endsWith( github.ref , 'Cog' ) | |
with: | |
prerelease: true | |
allowUpdates: true | |
replacesArtifacts: true | |
artifacts: ${{ env.PRODUCTS_PATH }}/${{ env.ASSET_NAME }}.${{ env.ASSET_EXTENSION }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ matrix.mode == 'debug' && 'latest-debug-build' || matrix.mode == 'assert' && 'latest-assert-build' || 'latest-build' }} | |
body: ${{ github.event.head_commit.message }} | |
- name: Deploy artifact as new release candidate | |
uses: ncipollo/release-action@v1 | |
if: github.event_name == 'workflow_dispatch' | |
with: | |
prerelease: true # release candidate | |
allowUpdates: true | |
replacesArtifacts: true | |
artifacts: ${{ env.PRODUCTS_PATH }}/${{ env.ASSET_NAME }}.${{ env.ASSET_EXTENSION }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ github.event.inputs.tag }} | |
body: ${{ github.event.head_commit.message }} |