Skip to content

Commit

Permalink
add github-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
theavege authored and zaher committed Dec 22, 2024
1 parent 8738795 commit 9253a31
Show file tree
Hide file tree
Showing 9 changed files with 187 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
github: URUWorks
patreon: URUWorks
ko_fi: uruworks
custom: ["https://www.paypal.me/URUWorks"]
34 changes: 34 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Current behavior**
A description of what is currently happening.

**Screenshots/Video**
If applicable, add screenshots/video to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. Windows 11]
- Version [e.g. 1.0.0.1]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
7 changes: 7 additions & 0 deletions .github/dependabot.yml
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"
34 changes: 34 additions & 0 deletions .github/workflows/make.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
name: Make

on:
push:
branches:
- "**"
pull_request:
branches:
- master
- main

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 make.sh build
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "use/minilib"]
path = use/minilib
url = [email protected]:parmaja/minilib.git
[submodule "use/minictrls"]
path = use/minictrls
url = [email protected]:parmaja/minictrls.git
80 changes: 80 additions & 0 deletions make.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
#!/usr/bin/env bash

function priv_clippit
(
cat <<EOF
Usage: bash ${0} [OPTIONS]
Options:
build Build program
EOF
)

function priv_lazbuild
(
if ! (which lazbuild); then
source '/etc/os-release'
case ${ID:?} in
debian | ubuntu)
printf '\x1b[32mInstall Lazarus.\x1b[0m\n' 1>&2
sudo apt-get update
sudo apt-get install -y lazarus{-ide-qt5,}
;;
esac
fi
declare -r COMPONENTS='use/components.txt'
if [[ -d "${COMPONENTS%%/*}" ]]; then
if [[ -f '.gitmodules' ]]; then
git submodule update --init --recursive --force --remote
fi
if [[ -f "${COMPONENTS}" ]]; then
while read -r; do
if [[ -n "${REPLY}" ]] &&
! (lazbuild --verbose-pkgsearch "${REPLY}") &&
! (lazbuild --add-package "${REPLY}") &&
! [[ -d "${COMPONENTS%%/*}/${REPLY}" ]]; then
printf '\x1b[32m\tdownload package %s\x1b[0m\n' "${REPLY}" 1>&2
declare -A VAR=(
[url]="https://packages.lazarus-ide.org/${REPLY}.zip"
[out]=$(mktemp)
)
wget --quiet --output-document "${VAR[out]}" "${VAR[url]}" >/dev/null
unzip -o "${VAR[out]}" -d "${COMPONENTS%%/*}/${REPLY}"
rm --verbose "${VAR[out]}"
fi
done < "${COMPONENTS}"
fi
find "${COMPONENTS%%/*}" -type 'f' -name '*.lpk' -exec \
lazbuild --add-package-link {} +
fi
printf '\x1b[32mBuild projects:\x1b[0m\n' 1>&2
declare -i errors=0
while read -r; do
declare -A VAR=(
[out]=$(mktemp)
)
if (lazbuild --recursive --no-write-project --build-mode='release' --widgetset='qt5' --build-all "${REPLY}" > "${VAR[out]}"); then
printf '\x1b[32m\t[%s]\tbuild project\t%s\x1b[0m\n' "${?}" "${REPLY}"
grep --color='always' 'Linking' "${VAR[out]}"
else
printf '\x1b[31m\t[%s]\tbuild project\t%s\x1b[0m\n' "${?}" "${REPLY}"
grep --color='always' --extended-regexp '(Error|Fatal):' "${VAR[out]}"
((errors+=1))
fi 1>&2
done < <(find 'src' -type 'f' -name '*.lpi' | grep -v 'backup' | sort)
exit "${errors}"
)

function priv_main
(
set -euo pipefail
if ((${#})); then
case ${1} in
build) priv_lazbuild ;;
*) priv_clippit ;;
esac
else
priv_clippit
fi
)

priv_main "${@}" >/dev/null
1 change: 1 addition & 0 deletions use/minictrls
Submodule minictrls added at aa7482
1 change: 1 addition & 0 deletions use/minilib
Submodule minilib added at a500f6

0 comments on commit 9253a31

Please sign in to comment.