From 6540b6caf0918ab00bc3bb675f7bd8009c5026e5 Mon Sep 17 00:00:00 2001 From: Paulo Gomes Date: Mon, 7 Feb 2022 13:00:21 +0000 Subject: [PATCH] TEMPORARY waiting for official image Signed-off-by: Paulo Gomes --- .github/workflows/e2e.yaml | 84 +++++++++++++++++++++++++++----------- Makefile | 4 +- hack/install-libraries.sh | 6 ++- 3 files changed, 66 insertions(+), 28 deletions(-) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 1c230115c..e46e8bd6f 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -3,8 +3,8 @@ name: e2e on: pull_request: push: - branches: - - main + # branches: + # - main permissions: contents: read # for actions/checkout to fetch code @@ -45,10 +45,45 @@ jobs: CREATE_CLUSTER: false run: make e2e - kind-linux-arm64: - # Hosted on Equinix - # Docs: https://github.com/fluxcd/flux2/tree/main/.github/runners - runs-on: [self-hosted, Linux, ARM64, equinix] + # kind-linux-arm64: + # # Hosted on Equinix + # # Docs: https://github.com/fluxcd/flux2/tree/main/.github/runners + # runs-on: [self-hosted, Linux, ARM64, equinix] + # steps: + # - name: Checkout + # uses: actions/checkout@v2 + # - name: Setup Go + # uses: actions/setup-go@v2 + # with: + # go-version: 1.17.x + # - name: Run tests + # run: make test + # - name: Prepare + # id: prep + # run: | + # echo ::set-output name=CLUSTER::arm64-${GITHUB_SHA:0:7}-$(date +%s) + # echo ::set-output name=CONTEXT::kind-arm64-${GITHUB_SHA:0:7}-$(date +%s) + # - name: Setup Kubernetes Kind + # run: | + # kind create cluster --name ${{ steps.prep.outputs.CLUSTER }} --kubeconfig=/tmp/${{ steps.prep.outputs.CLUSTER }} + # - name: Run e2e tests + # env: + # KIND_CLUSTER_NAME: ${{ steps.prep.outputs.CLUSTER }} + # KUBECONFIG: /tmp/${{ steps.prep.outputs.CLUSTER }} + # CREATE_CLUSTER: false + # BUILD_PLATFORM: linux/arm64 + # MINIO_TAG: RELEASE.2020-09-17T04-49-20Z-arm64 + # run: make e2e + # - name: Cleanup + # if: always() + # run: | + # kind delete cluster --name ${{ steps.prep.outputs.CLUSTER }} + # rm /tmp/${{ steps.prep.outputs.CLUSTER }} + + # Runs 'make test' on macos-10.15 to assure development environment for + # contributors using MacOS. + darwin-amd64: + runs-on: macos-10.15 steps: - name: Checkout uses: actions/checkout@v2 @@ -56,26 +91,27 @@ jobs: uses: actions/setup-go@v2 with: go-version: 1.17.x + - name: Restore Go cache + uses: actions/cache@v1 + with: + path: /home/runner/work/_temp/_github_home/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- - name: Run tests run: make test - - name: Prepare - id: prep - run: | - echo ::set-output name=CLUSTER::arm64-${GITHUB_SHA:0:7}-$(date +%s) - echo ::set-output name=CONTEXT::kind-arm64-${GITHUB_SHA:0:7}-$(date +%s) - - name: Setup Kubernetes Kind - run: | - kind create cluster --name ${{ steps.prep.outputs.CLUSTER }} --kubeconfig=/tmp/${{ steps.prep.outputs.CLUSTER }} - - name: Run e2e tests + - name: Setup Kubernetes + uses: engineerd/setup-kind@v0.5.0 + with: + version: v0.11.1 + image: kindest/node:v1.21.1@sha256:69860bda5563ac81e3c0057d654b5253219618a22ec3a346306239bba8cfa1a6 + - name: Setup Kustomize + uses: fluxcd/pkg/actions/kustomize@main + - name: Setup Helm + uses: fluxcd/pkg/actions/helm@main + - name: Verify + run: make verify + - name: Run E2E tests env: - KIND_CLUSTER_NAME: ${{ steps.prep.outputs.CLUSTER }} - KUBECONFIG: /tmp/${{ steps.prep.outputs.CLUSTER }} CREATE_CLUSTER: false - BUILD_PLATFORM: linux/arm64 - MINIO_TAG: RELEASE.2020-09-17T04-49-20Z-arm64 run: make e2e - - name: Cleanup - if: always() - run: | - kind delete cluster --name ${{ steps.prep.outputs.CLUSTER }} - rm /tmp/${{ steps.prep.outputs.CLUSTER }} diff --git a/Makefile b/Makefile index 552007dd1..6237bd012 100644 --- a/Makefile +++ b/Makefile @@ -3,8 +3,8 @@ IMG ?= fluxcd/source-controller TAG ?= latest # Base image used to build the Go binary -LIBGIT2_IMG ?= ghcr.io/fluxcd/golang-with-libgit2 -LIBGIT2_TAG ?= libgit2-1.1.1-4 +LIBGIT2_IMG ?= quay.io/paulinhu/golang-with-libgit2 +LIBGIT2_TAG ?= libgit2-1.1.1-7 # Allows for defining additional Docker buildx arguments, # e.g. '--push'. diff --git a/hack/install-libraries.sh b/hack/install-libraries.sh index cc5615c3d..229847fee 100755 --- a/hack/install-libraries.sh +++ b/hack/install-libraries.sh @@ -47,17 +47,19 @@ function setup_current() { # For MacOS development environments, download the amd64 static libraries released from from golang-with-libgit2. #TODO: update URL with official URL + TAG: - curl -o output.tar.gz -LO "https://github.com/pjbgf/golang-with-libgit2/releases/download/1.1.1-6/darwin-libs.tar.gz" + curl -o output.tar.gz -LO "https://github.com/pjbgf/golang-with-libgit2/releases/download/${TAG}/darwin-libs.tar.gz" DIR=libgit2-darwin NEW_DIR="$(/bin/pwd)/build/libgit2/${TAG}" INSTALLED_DIR="/Users/runner/work/golang-with-libgit2/golang-with-libgit2/build/${DIR}-amd64" tar -xf output.tar.gz + rm output.tar.gz mv "${DIR}" "${TAG}" mv "${TAG}/" "./build/libgit2" - sed -i "" "s;-L/Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/lib ;;g" "$(/bin/pwd)/build/libgit2/${TAG}/lib/pkgconfig/libgit2.pc" + # Removes abs path from build machine, and let iconv be resolved automatically by default search paths. + sed -i "" "s;-L/Applications/Xcode_.* ;;g" "$(/bin/pwd)/build/libgit2/${TAG}/lib/pkgconfig/libgit2.pc" # Update the prefix paths included in the .pc files. # This will make it easier to update to the location in which they will be used.