From d545818e197d808c621047f7ccca72caa4b4fb9c Mon Sep 17 00:00:00 2001 From: "Sean P. McDonald" Date: Thu, 29 Feb 2024 13:31:31 -0600 Subject: [PATCH] (PA-4644) Replace appveyor with github actions --- .../actions/run_cmake_and_make/action.yaml | 11 ++--- .../run_win_cmake_and_make/action.yaml | 33 ++++++++++++++ .github/workflows/ci_checks.yaml | 11 ++++- .github/workflows/release.yaml | 38 +++++++++------- CHANGELOG.md | 2 +- appveyor.yml | 44 ------------------- 6 files changed, 70 insertions(+), 69 deletions(-) create mode 100644 .github/actions/run_win_cmake_and_make/action.yaml delete mode 100644 appveyor.yml diff --git a/.github/actions/run_cmake_and_make/action.yaml b/.github/actions/run_cmake_and_make/action.yaml index 9d4535bd..5285721a 100644 --- a/.github/actions/run_cmake_and_make/action.yaml +++ b/.github/actions/run_cmake_and_make/action.yaml @@ -1,9 +1,6 @@ name: run_cmake_and_make inputs: - pkg_suffix: - description: leatherman package suffix - type: string cmake_extra_vars: description: extra vars for cmake type: string @@ -25,7 +22,7 @@ runs: shell: bash run: | rm locales/leatherman.pot && \ - cmake ${{ matrix.options.cmake_extra_vars }} . && \ - mkdir dest && \ - make ${{ matrix.options.make_command }} DESTDIR=./dest -j2 && \ - { [[ '${{ matrix.options.coveralls }}' == 'ON' ]] && coveralls --gcov-options '\-lp' -r . -b . -e src -e vendor >/dev/null || true; } + cmake ${{ inputs.cmake_extra_vars }} . && \ + mkdir -p /tmp/leatherman/dest && \ + make ${{ inputs.make_command }} DESTDIR=/tmp/leatherman/dest -j2 && \ + { [[ '${{ inputs.coveralls }}' == 'ON' ]] && coveralls --gcov-options '\-lp' -r . -b . -e src -e vendor >/dev/null || true; } diff --git a/.github/actions/run_win_cmake_and_make/action.yaml b/.github/actions/run_win_cmake_and_make/action.yaml new file mode 100644 index 00000000..a538ea5d --- /dev/null +++ b/.github/actions/run_win_cmake_and_make/action.yaml @@ -0,0 +1,33 @@ +name: run_win_cmake_and_make + +inputs: + cmake_extra_vars: + description: extra vars for cmake + type: string + +runs: + using: "composite" + steps: + - name: install the required tools + shell: pwsh + run: | + mkdir C:\tools\pl-build-tools\bin + Write-Output "Get-ToolsLocation `$args" | Out-File C:\tools\pl-build-tools\bin\Get-BinRoot.ps1 + $env:PATH="C:\tools\pl-build-tools\bin;$env:PATH" + choco install -y mingw-w64 -Version 5.2.0 -source https://www.myget.org/F/puppetlabs + choco install -y cmake -Version 3.2.2 -source https://www.myget.org/F/puppetlabs + choco install -y gettext -Version 0.19.6 -source https://www.myget.org/F/puppetlabs + choco install -y pl-toolchain-x64 -Version 2015.12.01.1 -source https://www.myget.org/F/puppetlabs + choco install -y pl-boost-x64 -Version 1.58.0.2 -source https://www.myget.org/F/puppetlabs + choco install -y pl-openssl-x64 -Version 1.0.24.1 -source https://www.myget.org/F/puppetlabs + choco install -y pl-curl-x64 -Version 7.46.0.1 -source https://www.myget.org/F/puppetlabs + + - name: run make + shell: pwsh + run: | + $env:PATH = $env:PATH.Replace("Git\bin", "Git\cmd") + $env:PATH = $env:PATH.Replace("Git\usr\bin", "Git\cmd") + $env:PATH = "C:\Ruby21-x64\bin;C:\tools\mingw64\bin;C:\tools\pl-build-tools;C:\Program Files\gettext-iconv;$env:PATH" + cmake -G "MinGW Makefiles" -DCMAKE_TOOLCHAIN_FILE="C:\tools\pl-build-tools\pl-build-toolchain.cmake" -DCMAKE_PREFIX_PATH=C:/tools/pl-build-tools -DCMAKE_INSTALL_PREFIX=C:/tools/leatherman -DBOOST_STATIC=ON -DLEATHERMAN_SHARED=ON ${{ inputs.cmake_extra_vars }} . + mingw32-make -j2 + ctest -V 2>&1 | %{ if ($_ -is [System.Management.Automation.ErrorRecord]) { $_ | c++filt } else { $_ } } diff --git a/.github/workflows/ci_checks.yaml b/.github/workflows/ci_checks.yaml index 0ca27244..83cdba49 100644 --- a/.github/workflows/ci_checks.yaml +++ b/.github/workflows/ci_checks.yaml @@ -29,9 +29,18 @@ jobs: steps: - name: checkout current pr uses: actions/checkout@v4 - - name: run CMake and Make + - name: run CMake and Make on Linux uses: ./.github/actions/run_cmake_and_make with: cmake_extra_vars: ${{ matrix.options.cmake_extra_vars }} make_command: ${{ matrix.options.make_command }} coveralls: ${{ matrix.options.coveralls }} + win_ci_checks: + strategy: + fail-fast: false + runs-on: windows-latest + steps: + - name: checkout current pr + uses: actions/checkout@v4 + - name: run CMake and Make on Windows + uses: ./.github/actions/run_win_cmake_and_make diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 36559be6..03eff1fb 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -9,30 +9,36 @@ permissions: contents: write jobs: - release: - strategy: - matrix: - options: - - make_command: all test install ARGS=-v - cmake_extra_vars: -DBOOST_STATIC=ON - - make_command: all test install ARGS=-v - cmake_extra_vars: -DLEATHERMAN_SHARED=ON - pkg_suffix: "-dynamic" + release-unix: runs-on: ubuntu-latest steps: - name: checkout current pr uses: actions/checkout@v4 - - name: docker pull and make - uses: ./.github/actions/docker_pull_and_make + - name: run CMake and Make on Linux + uses: ./.github/actions/run_cmake_and_make with: - cmake_extra_vars: ${{ matrix.options.cmake_extra_vars }} - make_command: ${{ matrix.options.make_command }} - pkg_suffix: ${{ matrix.options.pkg_suffix }} + cmake_extra_vars: all test install ARGS=-v + make_command: -DLEATHERMAN_SHARED=ON - name: build release artifact for tags if: startsWith(github.ref, 'refs/tags/') - run: tar czvf leatherman${{ matrix.options.pkg_suffix }}.tar.gz `find dest -type f -print` + run: tar czvf leatherman-dynamic.tar.gz `find /tmp/leatherman/dest -type f -print` - name: upload release artifacts for tag uses: softprops/action-gh-release@v1 if: startsWith(github.ref, 'refs/tags/') with: - files: leatherman${{ matrix.options.pkg_suffix }}.tar.gz \ No newline at end of file + files: leatherman-dynamic.tar.gz + release-win: + runs-on: windows-latest + steps: + - name: checkout current pr + uses: actions/checkout@v4 + - name: run CMake and Make on Windows + uses: ./.github/actions/run_win_cmake_and_make + - name: build release artifact for tags + if: startsWith(github.ref, 'refs/tags/') + run: 7z.exe a -t7z leatherman.7z C:\tools\leatherman\ + - name: upload release artifacts for tag + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + files: leatherman.7z diff --git a/CHANGELOG.md b/CHANGELOG.md index 9de63035..9b326b6b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -396,7 +396,7 @@ This is a maintenance release to re-sync the code version with the tag, in order - leatherman.dynamic\_library - cross-platform loading of dynamic libraries - leatherman.execution - cross-platform system invocation with input/output support - leatherman.file\_util - utilities for manipulating files, augmenting Boost.FileSystem -- leatherman.json\_container - a simplified C++ interface for rapidjson +- leatherman.json\_container - a simplified C++ interface for rapidjson - leatherman.ruby - support for embedding and working with the Ruby interpreter - leatherman.util - general C++ utilities - strings, augmenting Boost.Algorithms diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 048058cf..00000000 --- a/appveyor.yml +++ /dev/null @@ -1,44 +0,0 @@ -clone_depth: 10 -environment: - matrix: - - shared: ON - -init: - - | - choco install -y mingw-w64 -Version 5.2.0 -source https://www.myget.org/F/puppetlabs - choco install -y cmake -Version 3.2.2 -source https://www.myget.org/F/puppetlabs - choco install -y gettext -Version 0.19.6 -source https://www.myget.org/F/puppetlabs - choco install -y pl-toolchain-x64 -Version 2015.12.01.1 -source https://www.myget.org/F/puppetlabs - choco install -y pl-boost-x64 -Version 1.58.0.2 -source https://www.myget.org/F/puppetlabs - choco install -y pl-openssl-x64 -Version 1.0.24.1 -source https://www.myget.org/F/puppetlabs - choco install -y pl-curl-x64 -Version 7.46.0.1 -source https://www.myget.org/F/puppetlabs - - - ps: | - $env:PATH = $env:PATH.Replace("Git\bin", "Git\cmd") - $env:PATH = $env:PATH.Replace("Git\usr\bin", "Git\cmd") - -install: - - SET PATH=C:\Ruby21-x64\bin;C:\tools\mingw64\bin;C:\Program Files\gettext-iconv;%PATH% - -build_script: - - ps: cmake -G "MinGW Makefiles" -DCMAKE_TOOLCHAIN_FILE="C:\tools\pl-build-tools\pl-build-toolchain.cmake" -DCMAKE_INSTALL_PREFIX=C:\tools\leatherman -DBOOST_STATIC=ON -DLEATHERMAN_SHARED="$env:shared" . - - ps: mingw32-make -j2 - -test_script: - - ps: ctest -V 2>&1 | %{ if ($_ -is [System.Management.Automation.ErrorRecord]) { $_ | c++filt } else { $_ } } - - ps: mingw32-make install - - ps: 7z.exe a -t7z leatherman.7z C:\tools\leatherman\ - -artifacts: - - path: leatherman.7z - name: leatherman.7z - -deploy: - description: Leatherman build from AppVeyor - provider: GitHub - auth_token: - secure: RlVaba6k+N1/p56mjknNAwKrXQwQpKRn0SIr+AZ8TuVszFntRxl0qFPHcq4bOMui - artifact: leatherman.7z - on: - appveyor_repo_tag: true - shared: OFF