-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from theavege/add/github-actions
Add/GitHub actions
- Loading branch information
Showing
3 changed files
with
109 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
name: Make | ||
|
||
on: | ||
push: | ||
branches: | ||
- "**" | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
timeout-minutes: 120 | ||
strategy: | ||
matrix: | ||
os: | ||
- ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
|
||
- name: Build on Linux | ||
if: runner.os == 'Linux' | ||
shell: bash | ||
run: bash -x make.sh build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
#!/usr/bin/env bash | ||
|
||
function priv_clippit | ||
( | ||
cat <<EOF | ||
Usage: bash ${0} [OPTIONS] | ||
Options: | ||
build Build program | ||
EOF | ||
) | ||
|
||
function priv_pkgsearch | ||
( | ||
if ((${#})); then | ||
for REPLY in "${@}"; do | ||
lazbuild --verbose-pkgsearch "${REPLY}" || lazbuild --add-package "${REPLY}" | ||
done | ||
fi | ||
) | ||
|
||
function priv_packages | ||
( | ||
if [[ -d 'use' ]]; then | ||
git submodule update --init --recursive | ||
else | ||
mkdir 'use' | ||
fi | ||
if ((${#})); then | ||
for REPLY in "${@}"; do | ||
declare -A VAR=( | ||
[url]="https://packages.lazarus-ide.org/${REPLY}.zip" | ||
[out]=$(mktemp) | ||
[dir]=${REPLY##/*} | ||
) | ||
wget --output-document "${VAR[out]}" "${VAR[url]}" | ||
unzip -o "${VAR[out]}" -d "use/${VAR[dir]}" | ||
rm --verbose "${VAR[out]}" | ||
done | ||
fi | ||
find 'use' -type 'f' -name '*.lpk' -exec lazbuild --add-package-link {} + | ||
) | ||
|
||
function priv_main | ||
( | ||
set -euo pipefail | ||
if ! (which lazbuild); then | ||
source '/etc/os-release' | ||
case ${ID:?} in | ||
debian | ubuntu) | ||
sudo apt-get update | ||
sudo apt-get install -y lazarus | ||
;; | ||
esac | ||
fi | ||
if ((${#})); then | ||
case ${1} in | ||
build) | ||
priv_pkgsearch | ||
priv_packages 'FPSpreadsheet' 'Synapse40.1' | ||
find 'source' -type 'f' -name '*.lpi' \ | ||
-exec lazbuild --no-write-project --recursive --no-write-project {} 1>&2 + | ||
;; | ||
esac | ||
else | ||
priv_clippit | ||
fi | ||
) | ||
|
||
priv_main "${@}" >/dev/null |