Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport][v2.7] GHA CI #472

Merged
merged 25 commits into from
Jul 26, 2024
Merged

[Backport][v2.7] GHA CI #472

merged 25 commits into from
Jul 26, 2024

Conversation

alexandreLamarre
Copy link
Contributor

Backport of :
#455
#457
#469

alexandreLamarre and others added 15 commits May 13, 2024 11:41
Signed-off-by: Alexandre Lamarre <[email protected]>
Signed-off-by: Alexandre Lamarre <[email protected]>
Signed-off-by: Alexandre Lamarre <[email protected]>
Signed-off-by: Alexandre Lamarre <[email protected]>
Signed-off-by: Alexandre Lamarre <[email protected]>
Signed-off-by: Alexandre Lamarre <[email protected]>
Signed-off-by: Alexandre Lamarre <[email protected]>
Signed-off-by: Alexandre Lamarre <[email protected]>
Signed-off-by: Alexandre Lamarre <[email protected]>
Signed-off-by: Alexandre Lamarre <[email protected]>
Compile release binaries only for linux amd & arm

Change release binary name format to match previous one

Signed-off-by: Alexandre Lamarre <[email protected]>
Signed-off-by: Alexandre Lamarre <[email protected]>
@alexandreLamarre alexandreLamarre marked this pull request as ready for review June 13, 2024 10:56
workflow_call:
push:
branches:
- release/v5.0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this just be release/v* so we don't have to keep updating it?

build:
strategy:
matrix:
os : [
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra white-space at the end

jobs:
build:
strategy:
matrix:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternative to run on both platforms:

 strategy:
      matrix:
        archBox:
        - { arch: amd64, vmArch: x64 }
        - { arch: arm64, vmArch: arm64 }
    runs-on: runs-on,runner=1cpu-linux-${{ matrix.archBox.vmArch }},run-id=${{ github.run_id }}
    ```

with:
name: bro-build-artifacts-${{ matrix.os }}
path: ./dist/artifacts/
- name : Debug
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I use this too, but I assume we want to pull out the Debug parts once everything's working

- name : Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra white-space at end of line 37

}

k3d cluster delete $CLUSTER_NAME || true
k3d cluster create $CLUSTER_NAME --image "docker.io/rancher/k3s:${K3S_VERSION}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docker.io/ part isn't needed

echo "Timeout reached, exiting..."
exit 1
fi

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space on line 30 not needed (git diff is complaining about these)

FROM registry.suse.com/bci/bci-micro:latest
COPY bin/backup-restore-operator /usr/bin/
ENTRYPOINT ["backup-restore-operator"]
COPY --from=builder /usr/src/app/bin/backup-restore-operator /usr/bin/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra space after backup-restore-operator

}

source $(dirname $0)/version
source ./scripts/version
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought leaving it as $(dirname $0) would be better in case you're running this from some other directory

@@ -1,36 +1,16 @@
#!/bin/bash
set -ex
function echo_with_time {
echo "$(date --utc +%Y-%m-%dT%H:%M:%SZ) "$@""
echo "$(date --utc +%Y-%m-%dT%H:%M:%SZ) $*"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The --utc option isn't recognized on Darwin (/bin/date so I'm not running some variant) but -u is a shortcut for it on linux. So better to just go with -u

Copy link
Collaborator

@ericpromislow ericpromislow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just white-space issues, although you might want to try the dual-runner solution and see if CI succeeds on both platforms.

@ericpromislow ericpromislow dismissed their stale review July 2, 2024 16:21

Will wait until 2.9 is doe

@mallardduck
Copy link
Member

mallardduck commented Jul 19, 2024

I think that technically for both of these backports, we don't even need to bring the .github folder over. GHA always finds workflows based on the current default branch. And we're not likely to ever "rollback" and use an older branch as default, so they'll just be unused blobs of data on old branches.

As we move forward the new base branch (eventually release/v6.0) will inherit the same workflows we have when we branch. And for example, if we need different release processes for 6.0 while still using "old" workflows for old branches we would maintain both workflows in parallel and differ based on branches/tags that trigger them.

What is probably worth backporting though are mainly the parts that remove drone and bring the new build scripts. Since I think only scripts we put under .github will be in the context of the running action by default. And other scripts (like ./scripts folder) are accessed via what the GHA clones.

JK - in the process of my renovate testing today I realized that when you create a tag/release it will use workflows that exist in that local repo at that commit. Not the default branch .github/workflows file like I thought it did.

...just noticed the GHA job that ran after I added this fix has the value empty.
read the docs harder on GH and found out I read the wrong docs and mixed env var and context.
this changes it to use a valid context within the GHA
@alexandreLamarre alexandreLamarre requested a review from a team as a code owner July 25, 2024 21:03
@mallardduck mallardduck merged commit 39207bc into release/v3.0 Jul 26, 2024
3 checks passed
@mallardduck mallardduck deleted the backport-gha-ci-3 branch October 4, 2024 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants