Skip to content

Commit

Permalink
Create a container in the github action
Browse files Browse the repository at this point in the history
Rather than using a pre-built one on dockerhub. This
keeps all of the necessary state in the snek repository
and makes it easy to modify the container contents when
necessary.

Signed-off-by: Keith Packard <keithp@keithp.com>
  • Loading branch information
keith-packard committed May 11, 2020
1 parent c5ce657 commit 1de0363
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 10 deletions.
31 changes: 31 additions & 0 deletions .github/Dockerfile
@@ -0,0 +1,31 @@
FROM debian:unstable AS download-tarballs

RUN apt-get update && \
apt-get install -y wget gnupg && \
wget -O - https://keithp.com/archive/archive-key | apt-key add - && \
echo "deb http://keithp.com/archive unstable/" > /etc/apt/sources.list.d/keithp.list && \
apt-get update && \
apt-get upgrade -y && \
apt-get install -y \
build-essential \
libreadline-dev \
avr-libc \
gcc-avr \
gcc-arm-none-eabi \
gcc-riscv64-unknown-elf \
picolibc-arm-none-eabi \
picolibc-riscv64-unknown-elf \
python3 \
lola \
gawk \
asciidoctor \
ruby-asciidoctor-pdf \
ruby-coderay \
gcc-arm-linux-gnueabi \
libc6-dev-armel-cross \
black

RUN mkdir snek
COPY ./ snek/

WORKDIR ./snek
37 changes: 27 additions & 10 deletions .github/workflows/snek.yml
Expand Up @@ -3,18 +3,35 @@ name: snek
on: [push, pull_request]

jobs:
build:
test:
runs-on: ubuntu-latest
container:
image: phsilva/snek:latest

steps:
- uses: actions/checkout@v1
- run: make
- run: make check PREFIX=
- name: prepare artifacts
run: make DESTDIR=`pwd`/artifacts PREFIX= install
- uses: actions/upload-artifact@v1
- name: 'Clone snek'
uses: actions/checkout@v2
with:
path: snek

- name: 'Build snek container'
run: |
docker build -t snek \
-f snek/.github/Dockerfile \
snek
- name: 'Create install destinationn'
run: |
mkdir `pwd`/artifacts
- name: 'Build snek'
run: |
docker run --rm \
-e 'SNEK_RISCV=' \
-e 'SNEK_ARM=' \
--mount type=bind,source=`pwd`/artifacts,destination=/artifacts \
snek \
make DESTDIR=/artifacts PREFIX=/opt/snek check install
- name: 'Upload results'
uses: actions/upload-artifact@v2
with:
name: snek
path: artifacts

0 comments on commit 1de0363

Please sign in to comment.