extension: move to exactly-versioned devDependencies #61
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Code generated internal/ci/ci_tool.cue; DO NOT EDIT. | |
name: TryBot | |
"on": | |
push: | |
branches: | |
- ci/test | |
- master | |
workflow_dispatch: {} | |
pull_request: {} | |
jobs: | |
test: | |
runs-on: ubuntu-22.04 | |
if: |- | |
(contains(github.event.head_commit.message, ' | |
Dispatch-Trailer: {"type":"trybot"')) || ! (contains(github.event.head_commit.message, ' | |
Dispatch-Trailer: {"type":"')) | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
fetch-depth: 0 | |
- name: Reset git directory modification times | |
run: touch -t 202211302355 $(find * -type d) | |
- name: Restore git file modification times | |
uses: chetan/git-restore-mtime-action@075f9bc9d159805603419d50f794bd9f33252ebe | |
- id: DispatchTrailer | |
name: Try to extract Dispatch-Trailer | |
run: |- | |
x="$(git log -1 --pretty='%(trailers:key=Dispatch-Trailer,valueonly)')" | |
if [[ "$x" == "" ]] | |
then | |
# Some steps rely on the presence or otherwise of the Dispatch-Trailer. | |
# We know that we don't have a Dispatch-Trailer in this situation, | |
# hence we use the JSON value null in order to represent that state. | |
# This means that GitHub expressions can determine whether a Dispatch-Trailer | |
# is present or not by checking whether the fromJSON() result of the | |
# output from this step is the JSON value null or not. | |
x=null | |
fi | |
echo "value<<EOD" >> $GITHUB_OUTPUT | |
echo "$x" >> $GITHUB_OUTPUT | |
echo "EOD" >> $GITHUB_OUTPUT | |
- if: |- | |
((github.ref == 'refs/heads/master') && (! (contains(github.event.head_commit.message, ' | |
Dispatch-Trailer: {"type":"')))) && (contains(github.event.head_commit.message, ' | |
Dispatch-Trailer: {"type":"')) | |
name: Check we don't have Dispatch-Trailer on a protected branch | |
run: |- | |
echo "github.event.head_commit.message contains Dispatch-Trailer but we are on a protected branch" | |
false | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
cache: false | |
go-version: 1.23.1 | |
- name: Set common go env vars | |
run: |- | |
go env -w GOTOOLCHAIN=local | |
# Dump env for good measure | |
go env | |
- id: go-mod-cache-dir | |
name: Get go mod cache directory | |
run: echo "dir=$(go env GOMODCACHE)" >> ${GITHUB_OUTPUT} | |
- id: go-cache-dir | |
name: Get go build/test cache directory | |
run: echo "dir=$(go env GOCACHE)" >> ${GITHUB_OUTPUT} | |
- if: |- | |
(((github.ref == 'refs/heads/master') && (! (contains(github.event.head_commit.message, ' | |
Dispatch-Trailer: {"type":"')))) || (github.ref == 'refs/heads/ci/test')) | |
uses: actions/cache@v4 | |
with: | |
path: |- | |
${{ steps.go-mod-cache-dir.outputs.dir }}/cache/download | |
${{ steps.go-cache-dir.outputs.dir }} | |
key: ${{ runner.os }}-1.23.1-${{ github.run_id }} | |
restore-keys: ${{ runner.os }}-1.23.1 | |
- if: |- | |
! (((github.ref == 'refs/heads/master') && (! (contains(github.event.head_commit.message, ' | |
Dispatch-Trailer: {"type":"')))) || (github.ref == 'refs/heads/ci/test')) | |
uses: actions/cache/restore@v4 | |
with: | |
path: |- | |
${{ steps.go-mod-cache-dir.outputs.dir }}/cache/download | |
${{ steps.go-cache-dir.outputs.dir }} | |
key: ${{ runner.os }}-1.23.1-${{ github.run_id }} | |
restore-keys: ${{ runner.os }}-1.23.1 | |
- if: |- | |
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/[email protected] | |
with: | |
version: 0.10.0 | |
- name: Install Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.17.0 | |
- name: Install CUE | |
uses: cue-lang/[email protected] | |
with: | |
version: 0.10.0 | |
- name: Early git and code sanity checks | |
run: go run cuelang.org/go/internal/ci/[email protected] | |
- name: Verify | |
run: go mod verify | |
- name: Generate | |
run: |- | |
export CUE_CONFIG_DIR=$(mktemp -d) | |
echo "$CUE_LOGINS" > $CUE_CONFIG_DIR/logins.json | |
go generate ./... | |
env: | |
CUE_LOGINS: ${{ secrets.NOTCUECKOO_CUE_LOGINS }} | |
- name: Test | |
run: go test ./... | |
- name: Race test | |
run: go test -race ./... | |
- name: staticcheck | |
run: go run honnef.co/go/tools/cmd/[email protected] ./... | |
- name: Tidy | |
run: go mod tidy | |
- name: Install npm packages | |
working-directory: extension | |
run: npm ci | |
- name: Compile | |
working-directory: extension | |
run: npm run compile | |
- name: Update manifest.txt | |
run: cue cmd genManifest | |
working-directory: extension | |
- name: Extension publish dry-run | |
run: vsce package | |
working-directory: extension | |
- if: always() | |
name: Check that git is clean at the end of the job | |
run: test -z "$(git status --porcelain)" || (git status; git diff; false) |