From b5bf0fbe5dcd3f3bedd4240bf7649272a06daa58 Mon Sep 17 00:00:00 2001 From: cezmunsta Date: Thu, 1 Feb 2024 14:21:30 +0000 Subject: [PATCH 1/9] Updated workflow to use Mac M1 runner --- .github/workflows/pr-go.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/pr-go.yaml b/.github/workflows/pr-go.yaml index 6b36c06..96aebdb 100644 --- a/.github/workflows/pr-go.yaml +++ b/.github/workflows/pr-go.yaml @@ -17,8 +17,7 @@ jobs: build: strategy: matrix: - os: [ubuntu-latest] - #os: [ubuntu-latest, macos-latest] + os: [ubuntu-latest, macos-latest-xlarge] runs-on: ${{ matrix.os }} steps: - name: Harden Runner From 49bd3d37067a0ef505644c46a81b53f8b33bc696 Mon Sep 17 00:00:00 2001 From: cezmunsta Date: Thu, 1 Feb 2024 14:53:07 +0000 Subject: [PATCH 2/9] Updated runner image and OS steps --- .github/workflows/pr-go.yaml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-go.yaml b/.github/workflows/pr-go.yaml index 96aebdb..c2a541e 100644 --- a/.github/workflows/pr-go.yaml +++ b/.github/workflows/pr-go.yaml @@ -17,7 +17,7 @@ jobs: build: strategy: matrix: - os: [ubuntu-latest, macos-latest-xlarge] + os: [ubuntu-latest, macos-14] runs-on: ${{ matrix.os }} steps: - name: Harden Runner @@ -25,7 +25,8 @@ jobs: with: egress-policy: audit - - name: Prepare OS + - if: ${{ runner.os == "Linux" }} + name: Prepare OS id: podman_install run: | sudo apt update -qqy @@ -33,6 +34,13 @@ jobs: systemctl --user start podman echo "DOCKER_HOST=unix:///run/user/$UID/podman/podman.sock" >> "$GITHUB_ENV" + - if: ${{ runner.os == "macOS" }} + name: Prepare OS + id: podman_install + run: | + sudo brew install podman + echo "DOCKER_HOST=unix://$(podman machine inspect --format '{{.ConnectionInfo.PodmanSocket.Path}}' >)" >> "$GITHUB_ENV" + - name: Prepare Go uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 with: From 88bf8cc211b567b8a5b3f92dd724a1fbf5e82377 Mon Sep 17 00:00:00 2001 From: cezmunsta Date: Thu, 1 Feb 2024 14:57:02 +0000 Subject: [PATCH 3/9] Fixed condition --- .github/workflows/pr-go.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-go.yaml b/.github/workflows/pr-go.yaml index c2a541e..a1f0353 100644 --- a/.github/workflows/pr-go.yaml +++ b/.github/workflows/pr-go.yaml @@ -25,7 +25,7 @@ jobs: with: egress-policy: audit - - if: ${{ runner.os == "Linux" }} + - if: ${{ runner.os }} == "Linux" name: Prepare OS id: podman_install run: | @@ -34,7 +34,7 @@ jobs: systemctl --user start podman echo "DOCKER_HOST=unix:///run/user/$UID/podman/podman.sock" >> "$GITHUB_ENV" - - if: ${{ runner.os == "macOS" }} + - if: ${{ runner.os }} == "macOS" name: Prepare OS id: podman_install run: | From 63e15cfd70526ff033b17d674dded1bdbb8fea08 Mon Sep 17 00:00:00 2001 From: cezmunsta Date: Thu, 1 Feb 2024 15:01:06 +0000 Subject: [PATCH 4/9] Appended OS to install step ID --- .github/workflows/pr-go.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-go.yaml b/.github/workflows/pr-go.yaml index a1f0353..d86ecce 100644 --- a/.github/workflows/pr-go.yaml +++ b/.github/workflows/pr-go.yaml @@ -27,7 +27,7 @@ jobs: - if: ${{ runner.os }} == "Linux" name: Prepare OS - id: podman_install + id: podman_install_linux run: | sudo apt update -qqy sudo apt install -qqy podman @@ -36,7 +36,7 @@ jobs: - if: ${{ runner.os }} == "macOS" name: Prepare OS - id: podman_install + id: podman_install_macos run: | sudo brew install podman echo "DOCKER_HOST=unix://$(podman machine inspect --format '{{.ConnectionInfo.PodmanSocket.Path}}' >)" >> "$GITHUB_ENV" From 8f6fe81ddcec0dff1805884e4062a2556c36f699 Mon Sep 17 00:00:00 2001 From: cezmunsta Date: Thu, 1 Feb 2024 15:34:15 +0000 Subject: [PATCH 5/9] Refactored podman_install --- .github/workflows/pr-go.yaml | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/.github/workflows/pr-go.yaml b/.github/workflows/pr-go.yaml index 50f69ec..b6e81d8 100644 --- a/.github/workflows/pr-go.yaml +++ b/.github/workflows/pr-go.yaml @@ -25,21 +25,22 @@ jobs: with: egress-policy: audit - - if: ${{ runner.os }} == "Linux" - name: Prepare OS - id: podman_install_linux + - name: Prepare OS + id: podman_install run: | - sudo apt update -qqy - sudo apt install -qqy podman - systemctl --user start podman - echo "DOCKER_HOST=unix:///run/user/$UID/podman/podman.sock" >> "$GITHUB_ENV" - - - if: ${{ runner.os }} == "macOS" - name: Prepare OS - id: podman_install_macos - run: | - sudo brew install podman - echo "DOCKER_HOST=unix://$(podman machine inspect --format '{{.ConnectionInfo.PodmanSocket.Path}}' >)" >> "$GITHUB_ENV" + case "${{ runner.os }}" in + "macOS") + sudo brew install podman + echo "DOCKER_HOST=unix://$(podman machine inspect --format '{{.ConnectionInfo.PodmanSocket.Path}}' >)" >> "$GITHUB_ENV" + ;; + "Linux") + sudo apt update -qqy + sudo apt install -qqy podman + systemctl --user start podman + echo "DOCKER_HOST=unix:///run/user/$UID/podman/podman.sock" >> "$GITHUB_ENV" + ;; + \*) exit 1 + esac - name: Prepare Go uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 From fdc031079e9594e91be00d9230898a85200a712b Mon Sep 17 00:00:00 2001 From: cezmunsta Date: Thu, 1 Feb 2024 15:37:11 +0000 Subject: [PATCH 6/9] Removed sudo from brew --- .github/workflows/pr-go.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-go.yaml b/.github/workflows/pr-go.yaml index b6e81d8..69247e4 100644 --- a/.github/workflows/pr-go.yaml +++ b/.github/workflows/pr-go.yaml @@ -30,7 +30,7 @@ jobs: run: | case "${{ runner.os }}" in "macOS") - sudo brew install podman + brew install podman echo "DOCKER_HOST=unix://$(podman machine inspect --format '{{.ConnectionInfo.PodmanSocket.Path}}' >)" >> "$GITHUB_ENV" ;; "Linux") From 10f532a8f2735a5a1d6043370ef91562dbb4c84a Mon Sep 17 00:00:00 2001 From: cezmunsta Date: Thu, 1 Feb 2024 15:51:28 +0000 Subject: [PATCH 7/9] Fixed option for setup-go --- .github/workflows/pr-go.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-go.yaml b/.github/workflows/pr-go.yaml index 69247e4..885adca 100644 --- a/.github/workflows/pr-go.yaml +++ b/.github/workflows/pr-go.yaml @@ -46,7 +46,7 @@ jobs: uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 with: go-version: '1.21.5' - check_latest: false + check-latest: false - name: Checkout codebase uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 From f83bfa24d923307ca5c470340ee00ba5d677f8df Mon Sep 17 00:00:00 2001 From: cezmunsta Date: Thu, 1 Feb 2024 15:51:43 +0000 Subject: [PATCH 8/9] Fixed DOCKER_HOST for macOS --- .github/workflows/pr-go.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-go.yaml b/.github/workflows/pr-go.yaml index 885adca..c89ce9e 100644 --- a/.github/workflows/pr-go.yaml +++ b/.github/workflows/pr-go.yaml @@ -31,7 +31,7 @@ jobs: case "${{ runner.os }}" in "macOS") brew install podman - echo "DOCKER_HOST=unix://$(podman machine inspect --format '{{.ConnectionInfo.PodmanSocket.Path}}' >)" >> "$GITHUB_ENV" + echo "DOCKER_HOST=unix://$(podman machine inspect --format '{{.ConnectionInfo.PodmanSocket.Path}}')" >> "$GITHUB_ENV" ;; "Linux") sudo apt update -qqy From 2a7432cbd6da218b5394714541903671c092cdb8 Mon Sep 17 00:00:00 2001 From: cezmunsta Date: Thu, 1 Feb 2024 15:57:06 +0000 Subject: [PATCH 9/9] Update macOS preparation --- .github/workflows/pr-go.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pr-go.yaml b/.github/workflows/pr-go.yaml index c89ce9e..3b8b7b3 100644 --- a/.github/workflows/pr-go.yaml +++ b/.github/workflows/pr-go.yaml @@ -31,6 +31,8 @@ jobs: case "${{ runner.os }}" in "macOS") brew install podman + podman machine init + podman machine start echo "DOCKER_HOST=unix://$(podman machine inspect --format '{{.ConnectionInfo.PodmanSocket.Path}}')" >> "$GITHUB_ENV" ;; "Linux")