Skip to content

Commit

Permalink
ci: Add Docker setup and build job
Browse files Browse the repository at this point in the history
  • Loading branch information
joennlae authored and paulsc96 committed Feb 7, 2023
1 parent 15cb0b8 commit 6662d5b
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM ubuntu:22.04

RUN apt update && apt upgrade -y && apt install -y curl python3 build-essential git cmake

ARG RISCV_GCC_VERSION=8.3.0-2020.04.0
# risvc-gnu-compiler
RUN curl -Ls -o riscv-gcc.tar.gz https://static.dev.sifive.com/dev-tools/riscv64-unknown-elf-gcc-${RISCV_GCC_VERSION}-x86_64-linux-ubuntu14.tar.gz && \
mkdir -p /tools/riscv && chmod 777 /tools/riscv && \
tar -C /tools/riscv -xf riscv-gcc.tar.gz --strip-components=1

ENV PATH="${PATH}:/tools/riscv/bin"

# bender
ARG BENDER_VERSION=0.27.1
RUN mkdir -p /tools/bender && chmod 777 /tools/bender && \
cd /tools/bender && curl --proto '=https' --tlsv1.2 -sSf https://pulp-platform.github.io/bender/init | bash -s -- ${BENDER_VERSION}

ENV PATH="${PATH}:/tools/bender"

# slang
ARG SLANG_VERSION=v2.0
RUN mkdir -p /tools/slang && chmod 777 /tools/slang && \
cd /tools/slang && git clone https://github.com/MikePopoloski/slang.git && \
cd slang && git checkout ${SLANG_VERSION} && \
cmake -B build && cmake --build build -j$(nproc) && \
cmake --install build --strip
30 changes: 30 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: docker-image

on:
push:
branches: [ master, rc-docker-ci ]

jobs:
build:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Build and push
uses: docker/build-push-action@v3
with:
context: .
file: ./.github/Dockerfile
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/cheshire-ci:latest

0 comments on commit 6662d5b

Please sign in to comment.