From 8c437ee90a3de7249f7dcfb1d89a3f7f7c003ffe Mon Sep 17 00:00:00 2001 From: Robert Di Pardo Date: Sat, 1 Jun 2024 19:00:00 -0400 Subject: [PATCH] Use Actions for all build jobs --- .circleci/config.yml | 67 --------------------- .circleci/setup_msys2.ps1 | 25 -------- {.circleci => .github}/build_geany.sh | 0 .github/workflows/build.yml | 86 +++++++++++++++++++++++++++ README.rst | 6 +- 5 files changed, 89 insertions(+), 95 deletions(-) delete mode 100644 .circleci/config.yml delete mode 100644 .circleci/setup_msys2.ps1 rename {.circleci => .github}/build_geany.sh (100%) create mode 100644 .github/workflows/build.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 0f4b96010..000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,67 +0,0 @@ -version: 2.1 -# -# SPDX-FileCopyrightText: (c) 2023,2024 Robert Di Pardo -# SPDX-License-Identifier: GPL-3.0-or-later -# -# Permitted usage is detailed in the COPYING file. -# -orbs: - lazarus: rdipardo/lazarus@3 - win: circleci/windows@5 -jobs: - linux-make-all: - machine: - image: ubuntu-2204:current - resource_class: medium - environment: - # https://askubuntu.com/a/1431746 - NEEDRESTART_MODE: 'l' - DEBIAN_FRONTEND: 'noninteractive' - steps: - - checkout - - lazarus/install: - lazarus-version: '3.2' - platform: 'linux' - - run: - name: Fetch Geany source tree - command: | - git reset --hard - git submodule sync --recursive - git submodule update --init --recursive - - run: - name: Build Geany - command: bash ../.circleci/build_geany.sh - working_directory: geany - - run: - name: Build package and sample project - command: make - windows-lazbuild: - executor: - name: win/default - steps: - - checkout - - lazarus/install - - restore_cache: - keys: - - msys2-{{ arch }} - - msys2- - - run: - name: Set up msys2 - command: .\.circleci\setup_msys2.ps1 - - save_cache: - key: msys2-{{ arch }} - paths: - - C:\msys64 - - run: - name: Configure GTK library path - shell: bash.exe - command: | - sed -e "s/\({\$LibraryPath \).*$/\1'C:\/msys64\/mingw64\/lib'}/" -i example/fpgeanyplugindemo.lpr - - run: - name: Run lazbuild.exe - command: lazbuild --ws=gtk3 .\example\fpgeanyplugindemo.lpr -workflows: - test-deploy: - jobs: - - linux-make-all - - windows-lazbuild diff --git a/.circleci/setup_msys2.ps1 b/.circleci/setup_msys2.ps1 deleted file mode 100644 index 24723cc51..000000000 --- a/.circleci/setup_msys2.ps1 +++ /dev/null @@ -1,25 +0,0 @@ -# Source: https://www.msys2.org/docs/ci/#docker -# -# SPDX-FileCopyrightText: (c) Christoph Reiter et al. -# SPDX-License-Identifier: CC-BY-SA-4.0 OR CC0-1.0 -# -if ((Test-Path 'C:\msys64')) { exit 0 } -[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; -Invoke-WebRequest -UseBasicParsing -uri 'https://github.com/msys2/msys2-installer/releases/download/nightly-x86_64/msys2-base-x86_64-latest.sfx.exe' -OutFile msys2.exe; -.\msys2.exe -y -oC:\;; -Remove-Item msys2.exe; -function msys() { C:\msys64\usr\bin\bash.exe @('-lc') + @Args; } -msys ' '; -msys 'pacman --noconfirm -Syuu'; -msys 'pacman --noconfirm -Syuu'; -msys 'pacman --noconfirm -Scc'; -msys 'pacman --noconfirm -Syuu \ - git-core \ - intltool \ - base-devel \ - gettext \ - mingw-w64-x86_64-gcc \ - mingw-w64-x86_64-autotools \ - mingw-w64-x86_64-ccache \ - mingw-w64-x86_64-libtool \ - mingw-w64-x86_64-gtk3'; diff --git a/.circleci/build_geany.sh b/.github/build_geany.sh similarity index 100% rename from .circleci/build_geany.sh rename to .github/build_geany.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..79a9697cf --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,86 @@ +# +# SPDX-FileCopyrightText: (c) 2024 Robert Di Pardo +# SPDX-License-Identifier: GPL-3.0-or-later +# +# Permitted usage is detailed in the COPYING file. +# +name: Build + +on: + push: + paths: + - 'src/**' + - '**/*.lpk' + - '.github/workflows/build.yml' + pull_request: + +env: + LAZARUS_VERSION: '3.2' + ARTIFACT_NAME: fpgeanyplugindemo + +jobs: + linux-make-all: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + fetch-depth: 0 + - name: Restore Lazarus packages + id: lazarus-deb-cache + uses: actions/cache@v4 + with: + path: '/tmp/lazarus-src' + key: lazarus-${{ env.LAZARUS_VERSION }}-${{ runner.os }} + - name: Install Lazarus ${{ env.LAZARUS_VERSION }} + run: | + curl -sSL https://bitbucket.org/rdipardo/lazarus-orb/raw/alpha/src/scripts/install_lazarus.sh | bash + env: + # https://askubuntu.com/a/1421221 + NEEDRESTART_MODE: l + DEBIAN_FRONTEND: noninteractive + - name: Build Geany + run: bash ../.github/build_geany.sh + working-directory: geany + - name: Build package and sample plugin + run: make + - name: Upload ${{ env.ARTIFACT_NAME }}.so + uses: actions/upload-artifact@v4 + with: + name: ${{ env.ARTIFACT_NAME }}.so + path: example/bin/x86_64-linux/Release/${{ env.ARTIFACT_NAME }}.so + + windows-lazbuild: + runs-on: windows-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Restore Lazarus installer + id: lazarus-exe-cache + uses: actions/cache@v4 + with: + path: 'C:\lazarus-src' + key: lazarus-${{ env.LAZARUS_VERSION }}-${{ runner.os }} + - name: Install Lazarus ${{ env.LAZARUS_VERSION }} + shell: bash + run: | + curl -sSL https://bitbucket.org/rdipardo/lazarus-orb/raw/alpha/src/scripts/install_windows_lazarus.sh | bash + ./install.cmd + - name: Install GTK + uses: msys2/setup-msys2@v2 + with: + location: 'C:\Users\Public' + msystem: mingw64 + install: mingw-w64-x86_64-gtk3 + - name: Configure GTK library path + shell: bash + run: | + sed -e "s/\({\$LibraryPath \).*$/\1'C:\/Users\/Public\/msys64\/mingw64\/lib'}/" -i example/fpgeanyplugindemo.lpr + - name: Build plugin + run: lazbuild --ws=gtk3 .\example\fpgeanyplugindemo.lpr + - name: Upload ${{ env.ARTIFACT_NAME }}.dll + uses: actions/upload-artifact@v4 + with: + name: ${{ env.ARTIFACT_NAME }}.dll + path: example/bin/x86_64-win64/Release/${{ env.ARTIFACT_NAME }}.dll diff --git a/README.rst b/README.rst index 312d6d2fc..c0b542399 100644 --- a/README.rst +++ b/README.rst @@ -59,9 +59,9 @@ Requirements * fpc >= 3.2 * gtk >= 3.24.24 -.. |cci-build-status| image:: https://circleci.com/gh/rdipardo/fpgeanyplugin.svg?style=svg - :alt: CircleCI - :target: https://circleci.com/gh/rdipardo/fpgeanyplugin +.. |cci-build-status| image:: https://github.com/rdipardo/fpgeanyplugin/actions/workflows/build.yml/badge.svg?event=push + :alt: Build + :target: https://github.com/rdipardo/fpgeanyplugin/actions/workflows/build.yml .. |fpc| image:: https://img.shields.io/github/license/rdipardo/fpgeanyplugin?style=flat-square&color=lightblue&label=Free%20Pascal&logo=lazarus :alt: Built with Free Pascal