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

ci: Update Github Actions for Node 20. #6670

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions .github/workflows/post-merge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ jobs:
TELEMETRY_URL: ${{ secrets.TELEMETRY_URL }}

- name: Upload binaries
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: always()
with:
name: binaries
name: binaries-linux-windows
path: _release

release-build-darwin:
Expand All @@ -130,10 +130,10 @@ jobs:
TELEMETRY_URL: ${{ secrets.TELEMETRY_URL }}

- name: Upload binaries (darwin)
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: always()
with:
name: binaries
name: binaries-darwin
path: _release

deploy-edge:
Expand All @@ -149,9 +149,10 @@ jobs:
timeout-minutes: 60

- name: Download release binaries
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: binaries
pattern: binaries-*
merge-multiple: true
path: _release

- name: Set up Docker Buildx
Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/post-tag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Post Tag
on:
push:
tags:
- '*'
- "*"

jobs:
generate:
Expand Down Expand Up @@ -40,10 +40,10 @@ jobs:
TELEMETRY_URL: ${{ secrets.TELEMETRY_URL }}

- name: Upload binaries
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: always()
with:
name: binaries
name: binaries-linux-windows
path: _release

release-build-darwin:
Expand All @@ -70,10 +70,10 @@ jobs:
TELEMETRY_URL: ${{ secrets.TELEMETRY_URL }}

- name: Upload binaries (darwin)
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: always()
with:
name: binaries
name: binaries-darwin
path: _release

build:
Expand All @@ -89,9 +89,10 @@ jobs:
run: echo "TAG_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV

- name: Download release binaries
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: binaries
pattern: binaries-*
merge-multiple: true
path: _release

- name: Set up Docker Buildx
Expand Down
65 changes: 44 additions & 21 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
run: make clean generate

- name: Upload generated artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: generated
path: |
Expand All @@ -49,13 +49,19 @@ jobs:
run: ubuntu-22.04
targets: ci-go-ci-build-linux-static
go_tags: GO_TAGS="-tags=opa_no_oci"
variant_name: opa_no_ci
Copy link
Member

Choose a reason for hiding this comment

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

should this be named opa_no_oci like it is above? or are they just confusingly similar? :D

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So, the go_tags item in YAML is actually the whole string GO_TAGS="-tags=opa_no_oci", which is horrendous for downstream steps that expect just [a-zA-Z0-9_-]* as the expected character set. 😅 I took the lazy route, and added a new YAML item with just the important bits.

Copy link
Member

Choose a reason for hiding this comment

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

Right, but I meant that there’s a typo, or no? “ci” -> “oci”

arch: arm64
- os: windows
run: ubuntu-22.04
targets: ci-go-ci-build-windows
arch: amd64
# Note(philipc): The underlying make targets also build arm64_static,
# but the downstream targets only want the amd64 binaries, so amd64 is
# the artifact name we upload the darwin target to.
- os: darwin
run: macos-latest
targets: ci-build-darwin ci-build-darwin-arm64-static
arch: amd64
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this also contains arm64, it would have been nice if we could use all or something. But I suppose that would mess up the GOARCH env var ..

Perhaps we could do a third Upload Binaries step to handle the case where arch is empty 🤔.

This is very much a nit, so feel free to disregard 😄.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the interest of getting this merged, it may be worth adding a comment for that target about the situation, leaving the arch: amd64 field alone for now. 🤔

steps:
- name: Check out code
uses: actions/checkout@v4
Expand All @@ -71,7 +77,7 @@ jobs:
if: matrix.os == 'darwin'

- name: Download generated artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: generated

Expand All @@ -81,11 +87,18 @@ jobs:
GOARCH: ${{ matrix.arch }}
timeout-minutes: 30

- name: Upload binaries
uses: actions/upload-artifact@v3
if: always()
- name: Upload binaries - No Go tags
uses: actions/upload-artifact@v4
if: ${{ matrix.go_tags == '' }}
with:
name: binaries-${{ matrix.os }}-${{ matrix.arch }}
path: _release

- name: Upload binaries - Go tag variants
uses: actions/upload-artifact@v4
if: ${{ matrix.go_tags != '' && matrix.variant_name != '' }}
with:
name: binaries
name: binaries-variant-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.variant_name }}
path: _release

go-test:
Expand Down Expand Up @@ -114,7 +127,7 @@ jobs:
go-version: ${{ steps.go_version.outputs.go_version }}

- name: Download generated artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: generated

Expand Down Expand Up @@ -170,7 +183,7 @@ jobs:
- 'test/cases/**'

- name: Download generated artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: generated
if: steps.changes.outputs.wasm == 'true'
Expand All @@ -196,7 +209,7 @@ jobs:
uses: actions/checkout@v4

- name: Download generated artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: generated

Expand All @@ -215,7 +228,7 @@ jobs:
uses: actions/checkout@v4

- name: Download generated artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: generated

Expand All @@ -238,9 +251,10 @@ jobs:
platforms: arm64

- name: Download release binaries
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: binaries
pattern: binaries-*
merge-multiple: true
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh cool

path: _release

- name: Test amd64 images
Expand All @@ -251,30 +265,39 @@ jobs:
env:
GOARCH: arm64

# Note(philipc): We only run the amd64 targets.
smoke-test-binaries:
runs-on: ${{ matrix.os }}
runs-on: ${{ matrix.run }}
needs: go-build
strategy:
matrix:
include:
- os: ubuntu-22.04
- os: linux
run: ubuntu-22.04
exec: opa_linux_amd64
- os: ubuntu-22.04
arch: amd64
- os: linux
run: ubuntu-22.04
exec: opa_linux_amd64_static
arch: amd64
wasm: disabled
- os: macos-latest
- os: darwin
run: macos-latest
exec: opa_darwin_amd64
- os: windows-latest
arch: amd64
- os: windows
run: windows-latest
exec: opa_windows_amd64.exe
arch: amd64

steps:
- name: Check out code
uses: actions/checkout@v4

- name: Download release binaries
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: binaries
name: binaries-${{ matrix.os }}-${{ matrix.arch }}
path: _release

- name: Test binaries (Rego)
Expand All @@ -296,7 +319,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Download generated artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: generated
- uses: actions/setup-go@v5
Expand Down Expand Up @@ -346,7 +369,7 @@ jobs:
uses: peaceiris/actions-hugo@v3
with:
# keep this version in sync with the version in netlify.toml
hugo-version: '0.113.0'
hugo-version: "0.113.0"
extended: true

- name: Build docs site and test integrations data
Expand Down