657855bd41
Build / build (push) Failing after 9s
The ./hs Docker wrapper runs docker inside the Gitea runner container. Since project paths inside the runner container don't exist on the Docker host, the volume mount creates an empty /work directory, and Stack finds no packages (error S-8506). Fix: install Stack directly via get.haskellstack.org, use STACK_ROOT for caching, and build with stack directly (no Docker-in-Docker). Also add symlink for gitea-actions.sh convenience script.
50 lines
1.3 KiB
YAML
50 lines
1.3 KiB
YAML
name: Build
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
STACK_ROOT: .stack-root
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install Stack
|
|
run: |
|
|
curl -sSL https://get.haskellstack.org/ | sh
|
|
|
|
- name: Cache Stack
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: .stack-root
|
|
key: stack-v2-${{ runner.os }}-${{ hashFiles('stack.yaml', 'package.yaml') }}
|
|
restore-keys: stack-v2-${{ runner.os }}-
|
|
|
|
- name: Build
|
|
run: |
|
|
mkdir -p build
|
|
stack build --copy-bins --local-bin-path ./build
|
|
|
|
- name: Compress with UPX
|
|
run: |
|
|
UPX_VERSION="5.1.1"
|
|
UPX_ARCHIVE="upx-${UPX_VERSION}-amd64_linux.tar.xz"
|
|
UPX_DIR="/tmp/upx-${UPX_VERSION}-amd64_linux"
|
|
if [ ! -x "${UPX_DIR}/upx" ]; then
|
|
curl -fsSL "https://github.com/upx/upx/releases/download/v${UPX_VERSION}/${UPX_ARCHIVE}" \
|
|
| tar -xJ -C /tmp
|
|
fi
|
|
${UPX_DIR}/upx build/converge
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: converge
|
|
path: build/converge
|
|
compression-level: 0
|