-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Let's consider the following workflow:
name: ci
on: [push, pull_request]
jobs:
linux:
runs-on: ubuntu-latest
container: debian:buster
steps:
- name: git clone
uses: actions/checkout@main
- name: build
run: make
for job linux
it will first launch the container, then checkout the source code (inside of the already running container?), then run the build
step inside of the container.
What I want to be able to do is to add some pre-steps
which would be run outside of the container and before the container is launched. In particular, I need this to install qemu
and binfmt
packages.
So, the workflow would look something like this:
name: ci
on: [push, pull_request]
jobs:
linux:
runs-on: ubuntu-latest
container: igagis/my_image:arm
pre-steps:
- name: install qemu and binfmt
run: apt update && apt install --yes binfmt-support qemu-user-static
steps:
- name: git clone
uses: actions/checkout@main
- name: build
run: make
Note, that I changed the container image to my custom built image for ARM
architecture, i.e. all binaries inside of the image are ARM
binaries.
After installing qemu
and binfmt
it is possible to run ARM
binaries on x86_64
architecture, using emulation. This approach works for me on Travis-CI, but there I start the docker manually and, thus, I have full control over what I run in host environment and what inside of the container. Now I'm trying to move to github actions and have this problem that it is only possible to either run everything inside of the container or everything in host ubuntu virtual machine.