From ed37fa07aa523f99008539a43b6d9b25e180857c Mon Sep 17 00:00:00 2001 From: Paul Jolly Date: Wed, 4 Sep 2024 17:28:04 +0100 Subject: [PATCH] internal/ci: install Node as part of CI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In preparation for later changes in the stack that rely on Node. Also run earlyChecks as part of CI. This was missed in https://cuelang.org/cl/1200595. Signed-off-by: Paul Jolly Change-Id: I5dc807644f562863f9d2b79ea3db73acba3f66ab Reviewed-on: https://review.gerrithub.io/c/cue-lang/vscode-cue/+/1200694 TryBot-Result: CUEcueckoo Reviewed-by: Daniel Martí --- .github/workflows/trybot.yaml | 14 ++++++++++---- internal/ci/github/trybot.cue | 18 +++++++++++++++++- internal/ci/repo/repo.cue | 2 ++ 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/.github/workflows/trybot.yaml b/.github/workflows/trybot.yaml index 3144419..d16692e 100644 --- a/.github/workflows/trybot.yaml +++ b/.github/workflows/trybot.yaml @@ -64,10 +64,6 @@ jobs: # Dump env for good measure go env - - name: Install CUE - uses: cue-lang/setup-cue@v1.0.1 - with: - version: v0.11.0 - id: go-mod-cache-dir name: Get go mod cache directory run: echo "dir=$(go env GOMODCACHE)" >> ${GITHUB_OUTPUT} @@ -98,6 +94,16 @@ jobs: github.repository == 'cue-lang/vscode-cue' && (((github.ref == 'refs/heads/master') && (! (contains(github.event.head_commit.message, ' Dispatch-Trailer: {"type":"')))) || github.ref == 'refs/heads/ci/test') run: go clean -testcache + - name: Install CUE + uses: cue-lang/setup-cue@v1.0.1 + with: + version: v0.11.0 + - name: Install Node + uses: actions/setup-node@v4 + with: + node-version: 20.17.0 + - name: Early git and code sanity checks + run: go run cuelang.org/go/internal/ci/checks@v0.11.0-0.dev.0.20240903133435-46fb300df650 - run: cue login --token=${CUE_TOKEN} env: CUE_TOKEN: ${{ secrets.NOTCUECKOO_CUE_TOKEN }} diff --git a/internal/ci/github/trybot.cue b/internal/ci/github/trybot.cue index ff6adbe..87c6150 100644 --- a/internal/ci/github/trybot.cue +++ b/internal/ci/github/trybot.cue @@ -53,14 +53,22 @@ workflows: trybot: _repo.bashWorkflow & { steps: [ for v in _repo.checkoutCode {v}, + + // Install and setup Go for v in installGo {v}, + for v in _setupGoActionsCaches {v}, + // CUE setup _installCUE, - for v in _setupGoActionsCaches {v}, + // Node setup + _installNode, + + _repo.earlyChecks, _centralRegistryLogin, + // Go steps - currently independent of the extension { name: "Verify" run: "go mod verify" @@ -85,11 +93,19 @@ workflows: trybot: _repo.bashWorkflow & { name: "Tidy" run: "go mod tidy" }, + + // Final checks _repo.checkGitClean, ] } } +_installNode: githubactions.#Step & { + name: "Install Node" + uses: "actions/setup-node@v4" + with: "node-version": _repo.nodeVersion +} + _installCUE: githubactions.#Step & { name: "Install CUE" uses: "cue-lang/setup-cue@v1.0.1" diff --git a/internal/ci/repo/repo.cue b/internal/ci/repo/repo.cue index 7ee4d77..68ab072 100644 --- a/internal/ci/repo/repo.cue +++ b/internal/ci/repo/repo.cue @@ -17,3 +17,5 @@ botGitHubUserEmail: "cueckoo@gmail.com" linuxMachine: "ubuntu-22.04" latestGo: "1.23.x" + +nodeVersion: "20.17.0"