Skip to content

Commit

Permalink
ci: simply build all ports
Browse files Browse the repository at this point in the history
after days of trial and error, it is not possible to build ports on
GitHub Action runners yet. The reason is the limited size of disk on
runners. The FreeBSD VM needs at least 40 GB of disk to buid some ports.

the CI will fail. will try to fix it when more disk space is available
on GitHub Actions runners.
  • Loading branch information
trombik committed Oct 19, 2024
1 parent b0881ca commit e2b67b0
Showing 1 changed file with 13 additions and 69 deletions.
82 changes: 13 additions & 69 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ jobs:
list-ports:
runs-on: ubuntu-latest
outputs:
PORTS_TO_BUILD: ${{ steps.list-ports-to-build.outputs.PORTS_TO_BUILD }}
BUILD_ALL_PORTS: ${{ steps.build-all-ports.outputs.BUILD_ALL_PORTS }}
PORTS_TO_BUILD: ${{ steps.conclude-port-to-build.outputs.PORTS_TO_BUILD }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -24,7 +23,7 @@ jobs:
ci:
- ".github/workflows/*.yml"
- name: Build all ports in the repository
- name: List CI files
if: steps.filter.outputs.ci == 'true'
id: build-all-ports
run: |
Expand All @@ -36,10 +35,10 @@ jobs:
PORTS_TO_BUILD=`find * -type d -maxdepth 1 -mindepth 1 | tr '\n' ' ' | sed -e 's/ $//'`
# pass the JSON to other jobs
echo "BUILD_ALL_PORTS=${PORTS_TO_BUILD}" >> "${GITHUB_OUTPUT}"
echo "PORTS_TO_BUILD=${PORTS_TO_BUILD}" >> "${GITHUB_OUTPUT}"
cat "${GITHUB_OUTPUT}"
- name: List ports-to-build
- name: List changed ports
if: steps.filter.outputs.ports-to-build == 'true' && steps.filter.outputs.ci != 'true'
id: list-ports-to-build
run: |
Expand All @@ -57,77 +56,22 @@ jobs:
echo "PORTS_TO_BUILD=${PORTS_TO_BUILD}" >> "${GITHUB_OUTPUT}"
cat "${GITHUB_OUTPUT}"
filter-devel-esp-llvm-embedded-toolchain:

# XXX devel/esp-llvm-embedded-toolchain depends on riscv32-esp-elf and xtensa-esp-elf.
# that means the two dependencies must be built before
# devel/esp-llvm-embedded-toolchain. it takes more than 6 hours and the
# build is canceled. to avoid it, it is necessary:
#
# * to build the two
# * to cache the built packages
# * to build devel/esp-llvm-embedded-toolchain with the cache pre-filled
#
# in the first run, build all packages. in the second run, build
# devel/esp-llvm-embedded-toolchain
runs-on: ubuntu-latest
needs: list-ports
outputs:
PORTS_TO_BUILD: ${{ steps.filter.outputs.PORTS_TO_BUILD }}
PORTS_TO_BUILD_ORIG: ${{ steps.filter.outputs.PORTS_TO_BUILD_ORIG }}
steps:
- name: Filter devel/esp-llvm-embedded-toolchain from PORTS_TO_BUILD
id: filter
- name: Conclude PORTS_TO_BUILD
shell: sh
id: conclude-port-to-build
run: |
if [ ! -z "${{ needs.list-ports.outputs.BUILD_ALL_PORTS }}" ]; then
PORTS_TO_BUILD="${{ needs.list-ports.outputs.BUILD_ALL_PORTS }}"
elif [ ! -z "${{ needs.list-ports.outputs.PORTS_TO_BUILD }}" ]; then
PORTS_TO_BUILD="${{ needs.list-ports.outputs.PORTS_TO_BUILD }}"
else
echo "Building none"
PORTS_TO_BUILD=""
if [ ! -z "${{ steps.build-all-ports.outputs.PORTS_TO_BUILD }}" ]; then
PORTS_TO_BUILD="${{ steps.build-all-ports.outputs.PORTS_TO_BUILD }}"
elif [ ! -z "${{ steps.list-ports-to-build.outputs.PORTS_TO_BUILD }}" ]; then
PORTS_TO_BUILD="${{ steps.list-ports-to-build.outputs.PORTS_TO_BUILD }}"
fi
PORTS_TO_BUILD_ORIG="${PORTS_TO_BUILD}"
PORTS_TO_BUILD=`echo "${PORTS_TO_BUILD}" | \
tr ' ' '\n' | \
grep -v "devel/esp-llvm-embedded-toolchain" | \
tr '\n' ' ' | \
sed -e 's/ $//'`
echo "::notice ::Building ${PORTS_TO_BUILD}"
echo "PORTS_TO_BUILD=${PORTS_TO_BUILD}" >> "${GITHUB_OUTPUT}"
echo "PORTS_TO_BUILD_ORIG=${PORTS_TO_BUILD_ORIG}" >> "${GITHUB_OUTPUT}"
cat "${GITHUB_OUTPUT}"
build-ports:
name: Build ports (1st run)
needs: filter-devel-esp-llvm-embedded-toolchain
uses: ./.github/workflows/poudriere.yml
with:
ports-to-build: ${{ needs.filter-devel-esp-llvm-embedded-toolchain.outputs.PORTS_TO_BUILD }}

see-if-devel-esp-llvm-embedded-toolchain-needs-to-be-built:
name: See if devel/esp-llvm-embedded-toolchain needs to built
runs-on: ubuntu-latest
needs:
- build-ports
- filter-devel-esp-llvm-embedded-toolchain
outputs:
RESULT: ${{ steps.see-if-devel-esp-llvm-embedded-toolchain-needs-to-be-built.outputs.RESULT }}
steps:
- name: See if devel/esp-llvm-embedded-toolchain needs to be built
id: see-if-devel-esp-llvm-embedded-toolchain-needs-to-be-built
shell: sh
run: |
PORTS_TO_BUILD_ORIG="${{ needs.filter-devel-esp-llvm-embedded-toolchain.outputs.PORTS_TO_BUILD_ORIG }}"
RESULT=`echo "${PORTS_TO_BUILD_ORIG}" | tr ' ' '\n' | grep devel/esp-llvm-embedded-toolchain`
if [ -z "${RESULT}" ]; then
echo "RESULT=true" >> "${GITHUB_OUTPUT}"
fi
build-devel-esp-llvm-embedded-toolchain:
name: Build devel/esp-llvm-embedded-toolchain (2nd run)
needs: see-if-devel-esp-llvm-embedded-toolchain-needs-to-be-built
if: ${{ needs.see-if-devel-esp-llvm-embedded-toolchain-needs-to-be-built.outputs.RESULT }}
needs: list-ports
uses: ./.github/workflows/poudriere.yml
with:
ports-to-build: devel/esp-llvm-embedded-toolchain
ports-to-build: ${{ needs.list-ports.outputs.PORTS_TO_BUILD }}

0 comments on commit e2b67b0

Please sign in to comment.