-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update FreeBSD VM image to 1.0.1
- Loading branch information
Showing
1 changed file
with
65 additions
and
1 deletion.
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 |
---|---|---|
|
@@ -55,21 +55,36 @@ jobs: | |
remove-large-packages: 'true' | ||
remove-cached-tools: 'true' | ||
|
||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Download packages | ||
id: download-packages | ||
uses: dawidd6/action-download-artifact@v6 | ||
with: | ||
|
||
# download packages cache from previous workflow run | ||
workflow: poudriere.yml | ||
workflow_conclusion: completed | ||
name: packages-cache | ||
path: packages | ||
if_no_artifact_found: warn | ||
|
||
- name: poudriere bulk | ||
id: make | ||
uses: cross-platform-actions/[email protected] | ||
with: | ||
operating_system: freebsd | ||
version: '14.1' | ||
image_url: https://github.com/trombik/freebsd-builder-poudriere/releases/download/v1.0.0/freebsd-14.1-x86-64.qcow2 | ||
image_url: https://github.com/trombik/freebsd-builder-poudriere/releases/download/v1.0.1/freebsd-14.1-x86-64.qcow2 | ||
sync_files: true | ||
run: | | ||
set -x | ||
set -e | ||
df -h -tufs | ||
tree . | ||
poudriere ports -l | ||
poudriere jail -l | ||
|
@@ -80,6 +95,9 @@ jobs: | |
OVERLAY_DIR=`realpath .` | ||
PORT_TO_BUILD=${{ matrix.PORT }} | ||
# disable tmpfs to save memory | ||
echo USE_TMPFS=no | sudo tee -a /usr/local/etc/poudriere.conf | ||
# avoid crushing guest OS due to running out of disk space | ||
MAX_JOBS=1 | ||
|
@@ -90,6 +108,19 @@ jobs: | |
sudo poudriere ports -c -p overlay -B "${{ env.BRANCH_NAME }}" -m git+file -U "${OVERLAY_DIR}" | ||
poudriere ports -l | ||
# build pkg, which creates data/packages/${JAIL_NAME}-${PORTS_NAME}/All | ||
# so that packages cache can be extracted under the directory. | ||
# the `All` directory is a symlink and computed by poudriere. | ||
sudo poudriere bulk -j "${JAIL_NAME}" -b latest -J "${MAX_JOBS}" ports-mgmt/pkg | ||
tree "/usr/local/poudriere/data/packages/${JAIL_NAME}-${PORTS_NAME}/All" | ||
# pre-fill packages cache | ||
if [ -d packages ]; then | ||
ls -al packages | ||
cp -R packages/* "/usr/local/poudriere/data/packages/${JAIL_NAME}-${PORTS_NAME}/All/" | ||
rm -rf packages | ||
fi | ||
# build the ports with the overlay (-o) and binary packages from | ||
# PACKAGE_FETCH_URL (-b). Test the port with Q/A checks (-Ct). use | ||
# `true` to prevent failure on build failures. the job will fail | ||
|
@@ -100,6 +131,9 @@ jobs: | |
tree "/usr/local/poudriere/data/logs/bulk/${JAIL_NAME}-${PORTS_NAME}/latest/logs" | ||
sudo cp -R "/usr/local/poudriere/data/logs/bulk/${JAIL_NAME}-${PORTS_NAME}/latest/logs" ${OVERLAY_DIR}/logs | ||
# collect the built packages | ||
sudo cp -RL "/usr/local/poudriere/data/packages/${JAIL_NAME}-${PORTS_NAME}/All" "${OVERLAY_DIR}/packages" | ||
df -h -tufs | ||
- name: Create a safe port name from matrix.PORT | ||
|
@@ -115,6 +149,13 @@ jobs: | |
name: logs-${{ env.SAFE_PORT_NAME }} | ||
path: logs/ | ||
|
||
- name: upload packages | ||
id: packages-upload-step | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: packages-${{ env.SAFE_PORT_NAME }} | ||
path: packages/ | ||
|
||
- name: Fail if any build failed | ||
shell: sh | ||
run: | | ||
|
@@ -132,9 +173,32 @@ jobs: | |
cat failed_packages.txt | ||
echo "Logs are available in an artifact. ID: ${{ steps.logs-upload-step.outputs.artifact-id }}" | ||
echo "Packages are available in an artifact. ID: ${{ steps.packages-upload-step.outputs.artifact-id }}" | ||
EXIT_STATUS=0 | ||
if [ ! -z "${FAILED_PACKAGES}" ]; then | ||
EXIT_STATUS=1 | ||
fi | ||
exit "${EXIT_STATUS}" | ||
store-packages: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- build | ||
steps: | ||
- name: Download built packages | ||
uses: actions/download-artifact@v4 | ||
with: | ||
pattern: packages-* | ||
merge-multiple: true | ||
|
||
- name: List package cache | ||
shell: sh | ||
run: | | ||
tree packages | ||
- name: Upload packages cache for future builds | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: packages-cache | ||
path: packages |