Skip to content

Commit

Permalink
internal/ci: use node.js 20-compatible action versions
Browse files Browse the repository at this point in the history
In https://github.com/cue-lang/cue-trybot/actions/runs/7818771241 and
other such trybot output, we receive the following warning:

    Node.js 16 actions are deprecated. Please update the following
    actions to use Node.js 20: actions/checkout@v3, actions/setup-go@v4,
    actions/cache/restore@v3

Per:

    https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/

Node-based action maintainers need to migrate to use Node.js 20. This
requires them to release new versions, which most have done so via new
major versions.

Pick up those new major versions across all the Node-based actions we
use, where new versions are available that are based on Node 20.

Signed-off-by: Paul Jolly <paul@myitcv.io>
Change-Id: Id8c482c85e95dc6ea9b19d8786e0df4e18c2fad3
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1176571
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: CUEcueckoo <cueckoo@gmail.com>
  • Loading branch information
myitcv committed Feb 7, 2024
1 parent 5037afc commit 15a4b3e
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/evict_caches.yml
Expand Up @@ -13,7 +13,7 @@ jobs:
shell: bash
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/release.yml
Expand Up @@ -20,7 +20,7 @@ jobs:
if: ${{github.repository == 'cue-lang/cue'}}
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
Expand Down Expand Up @@ -63,24 +63,24 @@ jobs:
EOD
false
- name: Install Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
cache: false
go-version: 1.21.5
- name: Setup qemu
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
- name: Docker Login
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: docker.io
username: cueckoo
password: ${{ secrets.CUECKOO_DOCKER_PAT }}
- name: Install CUE
run: go install ./cmd/cue
- name: Install GoReleaser
uses: goreleaser/goreleaser-action@v3
uses: goreleaser/goreleaser-action@v5
with:
install-only: true
version: v1.22.1
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/trybot.yml
Expand Up @@ -33,7 +33,7 @@ jobs:
Dispatch-Trailer: {"type":"'))
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:
EOD
false
- name: Install Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
cache: false
go-version: ${{ matrix.go-version }}
Expand All @@ -89,7 +89,7 @@ jobs:
- if: |-
(((github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release-branch.')) && (! (contains(github.event.head_commit.message, '
Dispatch-Trailer: {"type":"')))) || (github.ref == 'refs/heads/ci/test'))
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |-
${{ steps.go-mod-cache-dir.outputs.dir }}/cache/download
Expand All @@ -99,7 +99,7 @@ jobs:
- if: |-
! (((github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release-branch.')) && (! (contains(github.event.head_commit.message, '
Dispatch-Trailer: {"type":"')))) || (github.ref == 'refs/heads/ci/test'))
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
with:
path: |-
${{ steps.go-mod-cache-dir.outputs.dir }}/cache/download
Expand Down Expand Up @@ -171,14 +171,14 @@ jobs:
if: |-
github.repository == 'cue-lang/cue' && ((github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release-branch.')) && (! (contains(github.event.head_commit.message, '
Dispatch-Trailer: {"type":"')))) && (matrix.go-version == '1.21.x' && matrix.runner == 'ubuntu-22.04')
uses: google-github-actions/auth@v1
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.E2E_GCLOUD_KEY }}
- if: |-
github.repository == 'cue-lang/cue' && ((github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release-branch.')) && (! (contains(github.event.head_commit.message, '
Dispatch-Trailer: {"type":"')))) && (matrix.go-version == '1.21.x' && matrix.runner == 'ubuntu-22.04')
name: gcloud setup for end-to-end tests
uses: google-github-actions/setup-gcloud@v1
uses: google-github-actions/setup-gcloud@v2
- if: |-
github.repository == 'cue-lang/cue' && ((github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release-branch.')) && (! (contains(github.event.head_commit.message, '
Dispatch-Trailer: {"type":"')))) && (matrix.go-version == '1.21.x' && matrix.runner == 'ubuntu-22.04')
Expand Down
10 changes: 5 additions & 5 deletions internal/ci/base/github.cue
Expand Up @@ -17,7 +17,7 @@ bashWorkflow: json.#Workflow & {

installGo: json.#step & {
name: "Install Go"
uses: "actions/setup-go@v4"
uses: "actions/setup-go@v5"
with: {
// We do our own caching in setupGoActionsCaches.
cache: false
Expand All @@ -28,7 +28,7 @@ installGo: json.#step & {
checkoutCode: {
#actionsCheckout: json.#step & {
name: "Checkout code"
uses: "actions/checkout@v3"
uses: "actions/checkout@v4"

// "pull_request" builds will by default use a merge commit,
// testing the PR's HEAD merged on top of the master branch.
Expand Down Expand Up @@ -223,7 +223,7 @@ setupGoActionsCaches: {
if !#readonly {
cacheStep & {
if: readWriteCacheExpr
uses: "actions/cache@v3"
uses: "actions/cache@v4"
}
},

Expand All @@ -236,7 +236,7 @@ setupGoActionsCaches: {
if: "! \(readWriteCacheExpr)"
}

uses: "actions/cache/restore@v3"
uses: "actions/cache/restore@v4"
},

if #cleanTestCache {
Expand Down Expand Up @@ -356,7 +356,7 @@ containsDispatchTrailer: {
//
// Dispatch-Trailer: {"type:}
//
let _typeCheck = [ if #type != _|_ {#type + "\""}, ""][0]
let _typeCheck = [if #type != _|_ {#type + "\""}, ""][0]
"""
(contains(\(_dispatchTrailerVariable), '\n\(dispatchTrailer): {"type":"\(_typeCheck)'))
"""
Expand Down
8 changes: 4 additions & 4 deletions internal/ci/github/release.cue
Expand Up @@ -49,15 +49,15 @@ workflows: release: _repo.bashWorkflow & {
},
json.#step & {
name: "Setup qemu"
uses: "docker/setup-qemu-action@v2"
uses: "docker/setup-qemu-action@v3"
},
json.#step & {
name: "Set up Docker Buildx"
uses: "docker/setup-buildx-action@v2"
uses: "docker/setup-buildx-action@v3"
},
json.#step & {
name: "Docker Login"
uses: "docker/login-action@v2"
uses: "docker/login-action@v3"
with: {
registry: "docker.io"
username: "cueckoo"
Expand All @@ -70,7 +70,7 @@ workflows: release: _repo.bashWorkflow & {
},
json.#step & {
name: "Install GoReleaser"
uses: "goreleaser/goreleaser-action@v3"
uses: "goreleaser/goreleaser-action@v5"
with: {
"install-only": true
version: _repo.goreleaserVersion
Expand Down
10 changes: 5 additions & 5 deletions internal/ci/github/trybot.cue
Expand Up @@ -125,15 +125,15 @@ workflows: trybot: _repo.bashWorkflow & {
// https://github.com/google-github-actions/setup-gcloud#service-account-key-json
{
name: "gcloud auth for end-to-end tests"
id: "auth"
uses: "google-github-actions/auth@v1"
id: "auth"
uses: "google-github-actions/auth@v2"
// E2E_GCLOUD_KEY is a key for the service account cue-e2e-ci,
// which has the Artifact Registry Repository Administrator role.
with: credentials_json: "${{ secrets.E2E_GCLOUD_KEY }}"
},
{
name: "gcloud setup for end-to-end tests"
uses: "google-github-actions/setup-gcloud@v1"
uses: "google-github-actions/setup-gcloud@v2"
},
{
name: "End-to-end test"
Expand All @@ -143,7 +143,7 @@ workflows: trybot: _repo.bashWorkflow & {
// since otherwise the repo admin access to create and delete repos does not work.
env: {
GITHUB_TOKEN: "${{ secrets.E2E_GITHUB_TOKEN }}"
CUE_LOGINS: "${{ secrets.E2E_CUE_LOGINS }}"
CUE_LOGINS: "${{ secrets.E2E_CUE_LOGINS }}"
}
run: """
cd internal/e2e
Expand All @@ -163,7 +163,7 @@ workflows: trybot: _repo.bashWorkflow & {
// TODO: consider adding more checks as per https://github.com/golang/go/issues/42119.
if: "\(_isLatestLinux)"
name: "Check"
run: """
run: """
for module in . internal/e2e; do
(
cd $module
Expand Down

0 comments on commit 15a4b3e

Please sign in to comment.