build(deps-dev): Bump vite from 5.4.6 to 5.4.14 in /ui #152
Workflow file for this run
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
name: CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
ci: | |
name: Run CI | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ ubuntu-latest ] | |
go: | |
- '1.20' | |
- '1.21' | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Set up Go ${{ matrix.go }} | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ matrix.go }} | |
- name: Set up Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 21 | |
cache: 'npm' | |
cache-dependency-path: ui/package-lock.json | |
# copy-pasta from https://github.com/caddyserver/caddy/blob/master/.github/workflows/ci.yml | |
- name: Print Go version and environment | |
id: go-vars | |
run: | | |
printf "Using go at: $(which go)\n" | |
printf "Go version: $(go version)\n" | |
printf "\n\nGo environment:\n\n" | |
go env | |
printf "\n\nSystem environment:\n\n" | |
env | |
echo "dir=$(go env GOCACHE)" >> ${GITHUB_OUTPUT} | |
- name: Cache the Go build cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.go-vars.outputs.dir }} | |
key: ${{ runner.os }}-${{ matrix.go }}-go-ci-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-${{ matrix.go }}-go-ci | |
- name: Get npm cache directory | |
id: npm-cache-dir | |
shell: bash | |
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT} | |
- uses: actions/cache@v3 | |
id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true' | |
with: | |
path: ${{ steps.npm-cache-dir.outputs.dir }} | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Get dependencies | |
run: | | |
npm --prefix ui install | |
go mod download | |
- name: Build | |
run: | | |
npm --prefix ui run build | |
go build -v ./... | |
- name: Test | |
run: go test -v ./... | |
lint: | |
name: Run golangci linter | |
timeout-minutes: 5 | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ ubuntu-latest ] | |
go: | |
- '1.20' | |
- '1.21' | |
steps: | |
- name: Check out source code | |
uses: actions/checkout@v4 | |
- name: Set up Go ${{ matrix.go }} | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ matrix.go }} | |
- name: Set up Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 21 | |
cache: 'npm' | |
cache-dependency-path: ui/package-lock.json | |
- name: Get npm cache directory | |
id: npm-cache-dir | |
shell: bash | |
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT} | |
- uses: actions/cache@v3 | |
id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true' | |
with: | |
path: ${{ steps.npm-cache-dir.outputs.dir }} | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Get node dependencies | |
run: | | |
npm --prefix ui install | |
- name: Build node | |
run: | | |
npm --prefix ui run build | |
- name: Run linter | |
uses: golangci/golangci-lint-action@v4 | |
with: | |
version: v1.56 |