From ab172707615fef9a642f49c0b91b8cd362ef38b6 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Thu, 1 Feb 2024 00:08:25 +0800 Subject: [PATCH 1/5] Use self-hosted FreeBSD runner --- .github/workflows/release.yaml | 36 ++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index ac9eabe9..8eaa52a3 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -247,6 +247,42 @@ jobs: path: | ./out/* + build-freebsd: + name: Build binary (FreeBSD) + runs-on: [self-hosted, FreeBSD, X64] + env: + CABAL_VER: 3.10.2.0 + MACOSX_DEPLOYMENT_TARGET: 10.13 + JSON_VERSION: "0.0.8" + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + S3_HOST: ${{ secrets.S3_HOST }} + ARTIFACT: "x86_64-portbld-freebsd-ghcup" + GHC_VER: 9.4.8 + ARCH: 64 + DISTRO: na + RUNNER_OS: FreeBSD + steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + submodules: 'true' + + - name: Run build + run: | + sed -i.bak -e 's/quarterly/latest/' /etc/pkg/FreeBSD.conf + pkg install -y ghc hs-cabal-install git bash misc/compat10x misc/compat11x misc/compat12x gmake llvm14 + tzsetup Etc/GMT + adjkerntz -a + bash .github/scripts/build.sh + - if: always() + name: Upload artifact + uses: actions/upload-artifact@v3 + with: + name: artifacts + path: | + ./out/* + test-linux: name: Test linux needs: "build-linux" From 1c32dbc88aec2def7e649c48d59a43d1a8787163 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Thu, 1 Feb 2024 16:02:20 +0800 Subject: [PATCH 2/5] Also install libiconv on FreeBSD --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 8eaa52a3..1c821b3d 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -271,7 +271,7 @@ jobs: - name: Run build run: | sed -i.bak -e 's/quarterly/latest/' /etc/pkg/FreeBSD.conf - pkg install -y ghc hs-cabal-install git bash misc/compat10x misc/compat11x misc/compat12x gmake llvm14 + pkg install -y ghc hs-cabal-install git bash misc/compat10x misc/compat11x misc/compat12x gmake llvm14 libiconv tzsetup Etc/GMT adjkerntz -a bash .github/scripts/build.sh From c74409b9a5b143178f1877cd536c58f46c635146 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Thu, 1 Feb 2024 16:02:34 +0800 Subject: [PATCH 3/5] Remove cleanup hack on ARM64 Linux --- .github/workflows/release.yaml | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 1c821b3d..5bb32e76 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -94,21 +94,15 @@ jobs: fail-fast: true matrix: include: - - os: [self-hosted, Linux, ARM64] + - os: [self-hosted, Linux, ARM64, maerwald] ARTIFACT: "armv7-linux-ghcup" GHC_VER: 9.2.8 ARCH: ARM - - os: [self-hosted, Linux, ARM64] + - os: [self-hosted, Linux, ARM64, maerwald] ARTIFACT: "aarch64-linux-ghcup" GHC_VER: 9.4.8 ARCH: ARM64 steps: - - uses: docker://arm64v8/debian:10 - name: Cleanup (aarch64 linux) - continue-on-error: true - with: - args: "find . -mindepth 1 -maxdepth 1 -exec rm -rf -- {} +" - - name: git config run: | git config --global --get-all safe.directory | grep '^\*$' || git config --global --add safe.directory "*" @@ -371,24 +365,18 @@ jobs: strategy: matrix: include: - - os: [self-hosted, Linux, ARM64] + - os: [self-hosted, Linux, ARM64, maerwald] ARTIFACT: "armv7-linux-ghcup" GHC_VER: 9.2.8 ARCH: ARM DISTRO: Ubuntu - - os: [self-hosted, Linux, ARM64] + - os: [self-hosted, Linux, ARM64, maerwald] ARTIFACT: "aarch64-linux-ghcup" GHC_VER: 9.4.8 ARCH: ARM64 DISTRO: Ubuntu steps: - - uses: docker://arm64v8/debian:10 - name: Cleanup (aarch64 linux) - continue-on-error: true - with: - args: "find . -mindepth 1 -maxdepth 1 -exec rm -rf -- {} +" - - name: Checkout code uses: actions/checkout@v3 with: From 0f7f5347d8339655ce836ffb335a5db63f62b767 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Thu, 1 Feb 2024 23:27:20 +0800 Subject: [PATCH 4/5] Force x86 self hosted runners for cross --- .github/workflows/cross.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cross.yaml b/.github/workflows/cross.yaml index c5403730..c83e5b19 100644 --- a/.github/workflows/cross.yaml +++ b/.github/workflows/cross.yaml @@ -19,7 +19,7 @@ env: jobs: build: name: Build linux binary - runs-on: ubuntu-latest + runs-on: [self-hosted, Linux, X64, maerwald] env: CABAL_VER: 3.10.1.0 JSON_VERSION: "0.0.7" From 2bfca3760cdbe2a815ee05adfe25cf4a7c56ac95 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Fri, 2 Feb 2024 22:36:13 +0800 Subject: [PATCH 5/5] Finalize FreeBSD CI --- .cirrus.yml | 28 ------------------------- .github/scripts/env.sh | 4 ++++ .github/workflows/release.yaml | 37 +++++++++++++++++++++++++++++++++- 3 files changed, 40 insertions(+), 29 deletions(-) delete mode 100644 .cirrus.yml diff --git a/.cirrus.yml b/.cirrus.yml deleted file mode 100644 index d3014adc..00000000 --- a/.cirrus.yml +++ /dev/null @@ -1,28 +0,0 @@ -freebsd_instance: - image_family: freebsd-13-2 - -build_task: - name: build - env: - GHC_VER: 9.4.8 - CABAL_VER: 3.10.2.0 - ARTIFACT: "x86_64-portbld-freebsd-ghcup" - ARCH: 64 - RUNNER_OS: FreeBSD - DISTRO: na - GITHUB_WORKSPACE: ${CIRRUS_WORKING_DIR} - JSON_VERSION: "0.0.7" - CIRRUS_CLONE_SUBMODULES: true - AWS_ACCESS_KEY_ID: ENCRYPTED[6ed6287e2dd78ab5f84b22232c5245834ab042bd8ba443883aaf4b4d1ecc0481add1fdfad5ae6f6a8cfb418e6f19b2fc] - AWS_SECRET_ACCESS_KEY: ENCRYPTED[16f3cda2954c7cee99444e6788eb5997382aa4ce1477e7523fef2586077541f43b5c816156961fc6b4677259679875a7] - S3_HOST: ENCRYPTED[ce961780a33159f7d1d8046956b5ac6ebc3bfc8149428e5f538576cda51d9f3d0c35b79cdd1e325793639ff6e31f889d] - install_script: - - sed -i.bak -e 's/quarterly/latest/' /etc/pkg/FreeBSD.conf - - pkg install -y ghc hs-cabal-install git bash misc/compat10x misc/compat11x misc/compat12x gmake llvm14 - script: - - tzsetup Etc/GMT - - adjkerntz -a - - bash .github/scripts/build.sh - - bash .github/scripts/test.sh - binaries_artifacts: - path: "out/*" diff --git a/.github/scripts/env.sh b/.github/scripts/env.sh index 088b4c8f..61fd3c65 100644 --- a/.github/scripts/env.sh +++ b/.github/scripts/env.sh @@ -9,6 +9,10 @@ fi export DEBIAN_FRONTEND=noninteractive export TZ=Asia/Singapore +if [ "${RUNNER_OS}" = "freebsd" ] ; then + export RUNNER_OS=FreeBSD +fi + export OS="$RUNNER_OS" export PATH="$HOME/.local/bin:$PATH" diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 5bb32e76..94023092 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -493,6 +493,41 @@ jobs: name: testfiles path: | ./test/ghcup-test/golden/unix/GHCupInfo*json + test-freebsd: + name: Test FreeBSD + needs: "build-freebsd" + runs-on: [self-hosted, FreeBSD, X64] + env: + CABAL_VER: 3.10.2.0 + MACOSX_DEPLOYMENT_TARGET: 10.13 + JSON_VERSION: "0.0.8" + ARTIFACT: "x86_64-portbld-freebsd-ghcup" + GHC_VER: 9.4.8 + ARCH: 64 + DISTRO: na + RUNNER_OS: FreeBSD + steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + submodules: 'true' + + - uses: actions/download-artifact@v3 + with: + name: artifacts + path: ./out + + - name: Run test + run: | + bash .github/scripts/test.sh + + - if: failure() + name: Upload artifact + uses: actions/upload-artifact@v3 + with: + name: testfiles + path: | + ./test/ghcup-test/golden/unix/GHCupInfo*json hls: name: hls needs: build-linux @@ -526,7 +561,7 @@ jobs: release: name: release - needs: ["test-linux", "test-arm", "test-macwin", "hls"] + needs: ["test-linux", "test-arm", "test-macwin", "test-freebsd", "hls"] runs-on: ubuntu-latest if: startsWith(github.ref, 'refs/tags/v') steps: