Merge pull request #2 from DrasLorus/cicd

tentative of actions
This commit is contained in:
Camille Monière 2022-02-14 15:57:58 +01:00 committed by GitHub
commit 1027b8fc09
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 59 additions and 0 deletions

9
.github/docker/Dockerfile vendored Normal file
View file

@ -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"]

14
.github/docker/entrypoint.sh vendored Executable file
View file

@ -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

36
.github/workflows/docker.yml vendored Normal file
View file

@ -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}}