From e7e7a8eba1d8e94a2af048aa122c6861106046b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camille=20Moni=C3=A8re?= Date: Mon, 14 Feb 2022 15:44:33 +0100 Subject: [PATCH] Tentative of action --- .github/docker/Dockerfile | 9 +++++++++ .github/docker/entrypoint.sh | 14 ++++++++++++++ .github/workflows/docker.yml | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+) create mode 100644 .github/docker/Dockerfile create mode 100755 .github/docker/entrypoint.sh create mode 100644 .github/workflows/docker.yml diff --git a/.github/docker/Dockerfile b/.github/docker/Dockerfile new file mode 100644 index 0000000..9ed4b76 --- /dev/null +++ b/.github/docker/Dockerfile @@ -0,0 +1,9 @@ +# Container image that runs your code +FROM archlinux:latest + + +# Copies your code file from your action repository to the filesystem path `/` of the container +COPY entrypoint.sh /entrypoint.sh + +# Code file to execute when the docker container starts up (`entrypoint.sh`) +RUN ["/entrypoint.sh"] diff --git a/.github/docker/entrypoint.sh b/.github/docker/entrypoint.sh new file mode 100755 index 0000000..cbe12b1 --- /dev/null +++ b/.github/docker/entrypoint.sh @@ -0,0 +1,14 @@ +#!/bin/bash -l + +pacman --needed --noconfirm -Syu base-devel cmake git catch2 wget + +mkdir /build-hls +chmod 777 /build-hls + +pushd /build-hls || exit 1 +wget https://github.com/DrasLorus/HLS_arbitrary_Precision_Types/releases/download/v0.0.1.rc2/PKGBUILD +useradd builder +su builder -c makepkg +pacman --noconfirm -U -- *.pkg.tar.zst +popd || exit 1 + diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..f5b1ba5 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,36 @@ +name: CMakeDocker + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +env: + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) + BUILD_TYPE: Release + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Build the docker image + run: docker build -t local/arch ${{ github.workspace }}/.github/docker + + - name: Configure CMake + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. + # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type + run: docker run -v ${{ github.workspace }}:/repo local/arch cmake -B /repo/build -S /repo -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DENABLE_XILINX=OFF -DENABLE_TESTING=ON + + - name: Build + # Build your program with the given configuration + run: docker run -v ${{ github.workspace }}:/repo local/arch cmake --build /repo/build --config ${{ env.BUILD_TYPE }} + + - name: Test + # Execute tests defined by the CMake configuration. + # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail + run: docker run -v ${{ github.workspace }}:/repo --workdir=/repo/build local/arch ctest -C ${{env.BUILD_TYPE}} \ No newline at end of file