Skip to content

Commit

Permalink
Cleanup, adds extra ARM workflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
marceltaeumel committed Jul 30, 2021
1 parent 049361c commit 3390650
Show file tree
Hide file tree
Showing 7 changed files with 153 additions and 46 deletions.
114 changes: 114 additions & 0 deletions .github/workflows/extra-arm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
name: Extra Monthly Builds (ARM)

on:
schedule:
- cron: '0 0 1 * *' # Build on the 1st of every month at midnight
workflow_dispatch:
inputs:
should-deploy:
description: 'Deploy on success'
required: true
default: "true" # No boolean support at the moment

# !! NOTICE !!
# This workflow spec is basically a copy of linux-arm.yml. It includes
# aspects of extra.yml for the manual workflow dispatch. Please update
# this file according to its original files.

jobs:
build:
strategy:
fail-fast: false # let them finish bc. mixed platforms
matrix:
include:
# Only Newspeak is configured for ARMv7
- arch: linux32ARMv7
flavor: newspeak.cog.spur
- arch: linux32ARMv7
flavor: newspeak.stack.spur
# Some other flavors for backwards compatibility
- arch: linux32ARMv6
flavor: pharo.cog.spur
- arch: linux32ARMv6
flavor: squeak.cog.v3
- arch: linux32ARMv6
flavor: squeak.stack.v3
# CogMT not ready yet
# - arch: linux32ARMv8
# flavor: squeak.cogmt.spur

runs-on: ubuntu-latest
name: ${{ matrix.flavor }} for ${{ matrix.arch }}
env:
ARCH: ${{ matrix.arch }}
ARCH_ARM: ${{ matrix.arch == 'linux32ARMv6' && 'armv6' || matrix.arch == 'linux32ARMv7' && 'armv7' || 'aarch64' }}
FLAVOR: ${{ matrix.flavor }}
MODE: fast # no assert or debug here
HEARTBEAT: threaded # itimer not supported
steps:
- name: Checkout files
uses: actions/checkout@v2

# 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@v2
with:
path: .thirdparty-cache
key: thirdparty-cache-linux-${{ env.ARCH_ARM }}

# https://github.com/marketplace/actions/run-on-architecture
- name: Build VM
uses: uraimo/[email protected]
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 libtool automake autoconf libltdl-dev
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@v2
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/[email protected]
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 }}
8 changes: 4 additions & 4 deletions .github/workflows/extra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ name: Extra Monthly Builds

on:
schedule:
- cron: '0 0 1 * *'
- cron: '0 0 1 * *' # Build on the 1st of every month at midnight
workflow_dispatch:
inputs:
should-deploy:
description: 'Deploy on success'
required: false
default: true
required: true
default: "true" # No boolean support at the moment


jobs:
Expand Down Expand Up @@ -94,7 +94,7 @@ jobs:

- name: Update artifact in latest-build
uses: ncipollo/[email protected]
if: github.event.inputs.should-deploy && endsWith( github.ref , 'Cog' )
if: github.event.inputs.should-deploy == 'true' && endsWith( github.ref , 'Cog' )
with:
prerelease: true
allowUpdates: true
Expand Down
30 changes: 6 additions & 24 deletions .github/workflows/linux-arm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
- '*src/**' # Generated VMMaker sources (incl. plugins)
- 'platforms/Cross/**'
- 'platforms/unix/**'
# Skip documentation
# Skip changes in documentation artifacts
- '!**.md'
- '!**HowToBuild'
pull_request:
Expand All @@ -31,33 +31,15 @@ jobs:
matrix:
arch:
- linux32ARMv6
# - linux32ARMv7 # Newspeak only, see "include:" below
# - linux64ARMv8
# - linux32ARMv7 # Newspeak only, see "extra-arm" workflow
- linux64ARMv8
flavor:
- squeak.cog.spur
# - squeak.stack.spur
- squeak.stack.spur
mode:
- fast
# - debug
# - assert
# include:
# # Only Newspeak is configured for ARMv7
# - arch: linux32ARMv7
# flavor: newspeak.cog.spur
# mode: fast
# - arch: linux32ARMv7
# flavor: newspeak.stack.spur
# mode: fast
# # Some other flavors for backwards compatibility
# - arch: linux32ARMv6
# flavor: pharo.cog.spur
# mode: fast
# - arch: linux32ARMv6
# flavor: squeak.cog.v3
# mode: fast
# - arch: linux32ARMv6
# flavor: squeak.stack.v3
# mode: fast
- debug
- assert

runs-on: ubuntu-latest
name: ${{ matrix.flavor }} for ${{ matrix.arch }}${{ matrix.mode == 'debug' && ' (DEBUG)' || matrix.mode == 'assert' && ' (ASSERT)' || '' }}
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@ name: Build for Linux (x86)
on:
push: # All branches, but appropriate paths only.
paths:
- '.github/workflows/linux.yml' # This workflow spec
- 'scripts/ci/*linux_x86.sh' # Support scripts for this workflow
# This workflow spec and its support scripts
- '.github/workflows/linux.yml'
- 'scripts/ci/*linux_x86.sh'
- 'scripts/ci/*build.sh'
- 'deploy/**'

# Relevant sources for this platform
- 'build.linux*/**' # Makefile-based build scripts
- '*src/**' # Generated VMMaker sources (incl. plugins)
- 'platforms/Cross/**'
- 'platforms/unix/**'

# Skip changes in documentation artifacts
- '!**.md'
- '!**HowToBuild'
pull_request:
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@ name: Build for macOS
on:
push: # All branches, but appropriate paths only.
paths:
- '.github/workflows/macos.yml' # This workflow spec
- 'scripts/ci/*build.sh' # Support scripts for this workflow
- 'deploy/**' # More support scripts for this workflow

# This workflow spec and its support scripts
- '.github/workflows/macos.yml'
- 'scripts/ci/*build.sh'
- 'deploy/**'
# Relevant sources for this platform
- 'build.macos*/**' # Makefile-based build scripts
- '*src/**' # Generated VMMaker sources (incl. plugins)
- 'platforms/Cross/**'
- 'platforms/iOS/**' # Note that 'platforms/Mac OS' is deprecated

# Skip changes in documentation artifacts
- '!**.md'
- '!**HowToBuild'
pull_request:
Expand All @@ -22,15 +23,14 @@ on:
- '**HowToBuild'



jobs:
build:
strategy:
fail-fast: true
matrix:
arch:
- macos64x64
# - macos32x86
# - macos32x86 # Might be deprecated in general
flavor:
- squeak.cog.spur
# - squeak.sista.spur # -Werror bc. decl. missing
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@ name: Build for Windows
on:
push: # All branches, but appropriate paths only.
paths:
- '.github/workflows/win.yml' # This workflow spec
- 'scripts/ci/*msys.sh' # Support scripts for this workflow
# This workflow spec and its support scripts
- '.github/workflows/win.yml'
- 'scripts/ci/*msys.sh'
- 'scripts/ci/*build.sh'
- 'deploy/**'

# Relevant sources for this platform
- 'build.win*/**' # Makefile-based build scripts
- '*src/**' # Generated VMMaker sources (incl. plugins)
- 'platforms/Cross/**'
- 'platforms/win32/**'

# Skip changes in documentation artifacts
- '!**.md'
- '!**HowToBuild'
pull_request:
Expand Down
15 changes: 12 additions & 3 deletions scripts/ci/actions_build.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
#!/bin/bash
# Uses:
set -e

# This script locates and executes the platform and flavor-specific
# build scripts, which are typically Makefile-based, to compile and
# link the configured VM flavor. It then copies the build artifacts to
# to the ./products directory for subsequent steps such as signing and
# packing and deploying.
#
# This script uses/requires to following variables:
# - ARCH (e.g., "macos64x64")
# - ARCH_ARM (only set for ARM builds in docker container)
# - FLAVOR (e.g., "squeak.cog.spur")
# - RUNNER_OS (i.e., "Linux", "macOS", "Windows")
# - HEARTBEAT (i.e., "threaded" or "itimer"; !! Linux only !!)
# Provides:
#
# This script provides variables for subsequent steps:
# - ASSET_REVISION (e.g., "202107261048")
# - ASSET_NAME (e.g., "squeak.cog.spur_macos64x64")
# - PRODUCTS_PATH (e.g., "products")
# - APP_NAME (e.g., "vm" or "sqcogspur64linuxht" or "Squeak.app")

set -e


if [[ "${RUNNER_OS}" == "Windows" ]]; then
source ./scripts/ci/actions_prepare_msys.sh
Expand Down

0 comments on commit 3390650

Please sign in to comment.