From df79e189ad0f1ee61723a6ebb064dcc6ee5ba1a0 Mon Sep 17 00:00:00 2001 From: Siziwe Lupondo Date: Tue, 2 Jul 2024 14:35:58 +0200 Subject: [PATCH 1/6] windows workflow tested by docker on my local machine Signed-off-by: Siziwe Lupondo --- .github/workflow/windows.yml | 80 ++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 .github/workflow/windows.yml diff --git a/.github/workflow/windows.yml b/.github/workflow/windows.yml new file mode 100644 index 00000000..315bf482 --- /dev/null +++ b/.github/workflow/windows.yml @@ -0,0 +1,80 @@ +name: Build and Package FLINT for Windows + +on: + push: + branches: + - develop + pull_request: + branches: + - develop + +jobs: + build-and-package: + name: Build and Package FLINT for Windows + runs-on: windows-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + ref: develop # Checkout the develop branch + + - name: Install CMake + run: | + choco install cmake --installargs '"ADD_CMAKE_TO_PATH=System"' + RefreshEnv.cmd + + - name: Install Git + run: | + choco install git + RefreshEnv.cmd + + - name: Install Visual Studio Build Tools + run: | + choco install visualstudio2019buildtools --package-parameters "--allWorkloads --includeRecommended" + RefreshEnv.cmd + + - name: Install Boost libraries + run: | + choco install boost-msvc-14.2 --params "/IncludeRecommended /IncludeLibraries" -y + RefreshEnv.cmd + + - name: Install other FLINT packages + run: | + choco install turtle-msvc-14.2 -y + choco install poco-msvc-14.2 -y + choco install libpq-msvc-14.2 -y + choco install gdal-msvc-14.2 -y + choco install sqlite3-msvc-14.2 -y + choco install fmt-msvc-14.2 -y + choco install libpqxx-msvc-14.2 -y + RefreshEnv.cmd + + - name: Set up environment variables + run: | + set BOOST_ROOT=C:\tools\boost\boost_1_75_0 + set PATH=%BOOST_ROOT%\lib;%PATH% + RefreshEnv.cmd + + - name: Configure and build with CMake + run: | + mkdir build + cd build + cmake -G "Visual Studio 16 2019" ` + -DCMAKE_INSTALL_PREFIX=..\..\.. ` + -DVCPKG_TARGET_TRIPLET=x64-windows ` + -DENABLE_TESTS=OFF ` + -DENABLE_MOJA.MODULES.ZIPPER=OFF ` + -DCMAKE_TOOLCHAIN_FILE=..\..\..\vcpkg\scripts\buildsystems\vcpkg.cmake .. + cmake --build . --config Release + + - name: Generate event.json + run: | + echo '${{ toJson(github.event) }}' > C:\Development\moja-global\FLINT\Source\build\event.json + + - name: Upload Artifact + if: success() + uses: actions/upload-artifact@v2 + with: + name: FLINT Windows Artifacts + path: C:\Development\moja-global\FLINT\Source\build \ No newline at end of file From 8c3dbb42a837ed9627de49a2ab32843e9347c3a5 Mon Sep 17 00:00:00 2001 From: Siziwe Lupondo Date: Mon, 5 Aug 2024 16:09:22 +0200 Subject: [PATCH 2/6] Docker Workflow Signed-off-by: Siziwe Lupondo --- .github/workflows/ubuntu.yml | 52 ++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/ubuntu.yml diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml new file mode 100644 index 00000000..ad95be7d --- /dev/null +++ b/.github/workflows/ubuntu.yml @@ -0,0 +1,52 @@ +name: Build Docker Image-ubuntu + +on: + push: + branches: + - main + - master + - develop + - Docker_workflow + pull_request: + branches: + - main + - master + - develop + - Docker_workflow + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Build Docker image + run: | + ls + pushd Docker + docker build -f Dockerfile.flint.ubuntu.18.04 -t moja/flint:ubuntu-18.04 . + popd + + - name: Save Docker image as artifact + run: | + docker save moja/flint:ubuntu-18.04 | gzip > flint_docker_image.tar.gz + shell: bash + + - name: Upload Docker image artifact + uses: actions/upload-artifact@v2 + with: + name: docker-image + path: flint_docker_image.tar.gz \ No newline at end of file From 377cad222268cedcf8f0e272907ee87c48ae6a13 Mon Sep 17 00:00:00 2001 From: Siziwe Lupondo Date: Mon, 5 Aug 2024 16:10:30 +0200 Subject: [PATCH 3/6] Docker workflow Signed-off-by: Siziwe Lupondo --- .github/workflow/windows.yml | 80 ------------------------------------ 1 file changed, 80 deletions(-) delete mode 100644 .github/workflow/windows.yml diff --git a/.github/workflow/windows.yml b/.github/workflow/windows.yml deleted file mode 100644 index 315bf482..00000000 --- a/.github/workflow/windows.yml +++ /dev/null @@ -1,80 +0,0 @@ -name: Build and Package FLINT for Windows - -on: - push: - branches: - - develop - pull_request: - branches: - - develop - -jobs: - build-and-package: - name: Build and Package FLINT for Windows - runs-on: windows-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - with: - ref: develop # Checkout the develop branch - - - name: Install CMake - run: | - choco install cmake --installargs '"ADD_CMAKE_TO_PATH=System"' - RefreshEnv.cmd - - - name: Install Git - run: | - choco install git - RefreshEnv.cmd - - - name: Install Visual Studio Build Tools - run: | - choco install visualstudio2019buildtools --package-parameters "--allWorkloads --includeRecommended" - RefreshEnv.cmd - - - name: Install Boost libraries - run: | - choco install boost-msvc-14.2 --params "/IncludeRecommended /IncludeLibraries" -y - RefreshEnv.cmd - - - name: Install other FLINT packages - run: | - choco install turtle-msvc-14.2 -y - choco install poco-msvc-14.2 -y - choco install libpq-msvc-14.2 -y - choco install gdal-msvc-14.2 -y - choco install sqlite3-msvc-14.2 -y - choco install fmt-msvc-14.2 -y - choco install libpqxx-msvc-14.2 -y - RefreshEnv.cmd - - - name: Set up environment variables - run: | - set BOOST_ROOT=C:\tools\boost\boost_1_75_0 - set PATH=%BOOST_ROOT%\lib;%PATH% - RefreshEnv.cmd - - - name: Configure and build with CMake - run: | - mkdir build - cd build - cmake -G "Visual Studio 16 2019" ` - -DCMAKE_INSTALL_PREFIX=..\..\.. ` - -DVCPKG_TARGET_TRIPLET=x64-windows ` - -DENABLE_TESTS=OFF ` - -DENABLE_MOJA.MODULES.ZIPPER=OFF ` - -DCMAKE_TOOLCHAIN_FILE=..\..\..\vcpkg\scripts\buildsystems\vcpkg.cmake .. - cmake --build . --config Release - - - name: Generate event.json - run: | - echo '${{ toJson(github.event) }}' > C:\Development\moja-global\FLINT\Source\build\event.json - - - name: Upload Artifact - if: success() - uses: actions/upload-artifact@v2 - with: - name: FLINT Windows Artifacts - path: C:\Development\moja-global\FLINT\Source\build \ No newline at end of file From b618f172091f02d73df86cb5eb0e4dbcf27adfcb Mon Sep 17 00:00:00 2001 From: Siziwe Lupondo Date: Mon, 5 Aug 2024 19:53:40 +0200 Subject: [PATCH 4/6] Docker workflow Signed-off-by: Siziwe Lupondo --- .github/workflows/ubuntu.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index ad95be7d..4f92241e 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -3,7 +3,7 @@ name: Build Docker Image-ubuntu on: push: branches: - - main + - main - master - develop - Docker_workflow From f3ed4f62c59b2b760c0d65bc861c65da2aede192 Mon Sep 17 00:00:00 2001 From: Siziwe Lupondo Date: Mon, 5 Aug 2024 20:09:13 +0200 Subject: [PATCH 5/6] Docker Credentials Signed-off-by: Siziwe Lupondo --- .github/workflows/ubuntu.yml | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 4f92241e..d3f9a863 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -3,16 +3,16 @@ name: Build Docker Image-ubuntu on: push: branches: - - main - - master - - develop - - Docker_workflow + - main + - master + - develop + - Docker_workflow pull_request: branches: - - main - - master - - develop - - Docker_workflow + - main + - master + - develop + - Docker_workflow jobs: build: @@ -25,6 +25,12 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 + - name: Log in to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Cache Docker layers uses: actions/cache@v2 with: @@ -37,16 +43,16 @@ jobs: run: | ls pushd Docker - docker build -f Dockerfile.flint.ubuntu.18.04 -t moja/flint:ubuntu-18.04 . + docker build -f Dockerfile.flint.ubuntu.18.04 -t moja/flint:ubuntu-18.04 . popd - name: Save Docker image as artifact run: | - docker save moja/flint:ubuntu-18.04 | gzip > flint_docker_image.tar.gz + docker save moja/flint:ubuntu-18.04 | gzip > flint_docker_image.tar.gz shell: bash - name: Upload Docker image artifact uses: actions/upload-artifact@v2 with: name: docker-image - path: flint_docker_image.tar.gz \ No newline at end of file + path: flint_docker_image.tar.gz From ca1027804487b362a251c2a3c0a9861be88c2f4c Mon Sep 17 00:00:00 2001 From: Siziwe Lupondo Date: Tue, 6 Aug 2024 13:24:36 +0200 Subject: [PATCH 6/6] Removed other baraches that i do not have access to Signed-off-by: Siziwe Lupondo --- .github/workflows/ubuntu.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index d3f9a863..723af8c0 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -3,16 +3,12 @@ name: Build Docker Image-ubuntu on: push: branches: - - main - - master - develop - Docker_workflow pull_request: branches: - - main - - master - - develop - - Docker_workflow + - develop + - Docker_workflow jobs: build: