Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add/GitHub actions #49

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 scripts/make.sh build
6 changes: 0 additions & 6 deletions scripts/compile_Linux.sh

This file was deleted.

10 changes: 0 additions & 10 deletions scripts/debug_Linux.sh

This file was deleted.

2 changes: 0 additions & 2 deletions scripts/findInFiles.sh

This file was deleted.

2 changes: 0 additions & 2 deletions scripts/formatCode.sh

This file was deleted.

63 changes: 63 additions & 0 deletions scripts/make.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#!/usr/bin/env bash

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

function priv_fpcbuild
(
printf "\x1b[33mCompiling Axes, Armour & Ale...\x1b[0m\n"
mkdir -p source/lib/x86_64-linux
if pushd source; then
fpc Axes.pas -MObjFPC -Scghi -CX -Cg -Os3 -Xs -XX -l -vewnhibq -Filib/x86_64-linux -Fientities -Fidungeons -Fudungeons -Fuentities -Fuitems -Fuplayer -Fuscreens -Fuvision -Fuentities/animals -Fuentities/bugs -Fuentities/fungus -Fuentities/gnomes -Fuentities/hobs -Fuitems/armour -Fuitems/macguffins -Fuitems/weapons -Fuentities/bogles -Fuentities/undead -Fuentities/goblinkin -Fuentities/troglodytes -Fuentities/npc -Fuitems/traps -Fu. -FUlib/x86_64-linux -FE. -oAxes
fi
printf "\x1b[32m\t...complete!\x1b[0m\n"
)

function priv_fpcdebug
(
printf "Compiling Axes, Armour & Ale - DEBUG VERSION\n"
mkdir -p source/lib/x86_64-linux
if pushd source; then
fpc Axes.pas -Mfpc -Scaghi -Cg -CirotR -O1 -gw2 -godwarfsets -gl -gh -Xg -gt -l -vewnhibq -Filib/x86_64-linux -Fientities -Fudungeons -Fuentities -Fuitems -Fuplayer -Fuscreens -Fuvision -Fuentities/animals -Fuentities/fungus -Fuentities/gnomes -Fuentities/hobs -Fuitems/armour -Fuitems/macguffins -Fuitems/weapons -Fuitems/traps -Fuentities/bugs -Fuentities/bogles -Fuentities/undead -Fuentities/goblinkin -Fuentities/troglodytes -Fuentities/npc -Fu. -FUlib/x86_64-linux -FE. -oAxes
fi
printf "\tcleaning up files....\n"
delp -r ./
printf "\tupdating tags file...\n"
ctags -R --languages=Pascal
printf "Complete.\n"
)

function priv_main
(
set -euo pipefail
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
if ((${#})); then
case ${1} in
build) priv_fpcbuild 1>&2 ;;
debug) priv_fpcdebug ;;
find) grep --color=always --include=\*.pas -rnw . -e "${2}" ;;
format) ptop -c ptop.cfg "${2}"{,} ;;
tidyUp) delp -r ./ && ctags -R --languages=Pascal ;;
*) priv_clippit ;;
esac
else
priv_clippit
fi
)

priv_main "${@}" >/dev/null
3 changes: 0 additions & 3 deletions scripts/tidyUp.sh

This file was deleted.