Skip to content

feat: implement project details live refresh #1475

feat: implement project details live refresh

feat: implement project details live refresh #1475

Workflow file for this run

name: CI
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
test-unit:
runs-on: ubuntu-latest
container:
image: golang:1.20.7-bookworm
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: /go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Run unit tests
run: make test-unit
- name: Upload coverage reports
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
lint-go:
runs-on: ubuntu-latest
container:
image: golang:1.20.7-bookworm
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install linter
env:
GOLANGCI_LINT_VERSION: 1.53.3
working-directory: /usr/local/bin
run: |
curl -sSfL https://github.com/golangci/golangci-lint/releases/download/v${GOLANGCI_LINT_VERSION}/golangci-lint-${GOLANGCI_LINT_VERSION}-linux-amd64.tar.gz \
| tar xvz golangci-lint-${GOLANGCI_LINT_VERSION}-linux-amd64/golangci-lint --strip-components=1
- name: Run linter
env:
GO_LINT_ERROR_FORMAT: github-actions
run: make lint-go
lint-charts:
runs-on: ubuntu-latest
container:
image: golang:1.20.7-bookworm
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install linter
run: |
cd /usr/local/bin
curl -sSfL https://get.helm.sh/helm-v3.10.0-linux-amd64.tar.gz \
| tar xvz linux-amd64/helm --strip-components=1
- name: Run linter
run: make lint-charts
lint-proto:
runs-on: ubuntu-latest
container:
image: golang:1.20.7-bookworm
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install linter
uses: bufbuild/buf-setup-action@v1
with:
version: "1.20.0"
- name: Run linter
env:
BUF_LINT_ERROR_FORMAT: github-actions
run: make lint-proto
check-codegen:
runs-on: ubuntu-latest
container:
image: golang:1.20.7-bookworm
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
run_install: false
- name: Install nodejs
uses: actions/setup-node@v3
with:
node-version: "18.16.1"
cache: "pnpm"
cache-dependency-path: "**/pnpm-lock.yaml"
- name: Install nodejs dependencies
run: pnpm install --dev
working-directory: ./ui
- uses: actions/cache@v3
with:
path: /go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install buf
run: go install github.com/bufbuild/buf/cmd/[email protected]
- name: Install controller-gen
run: go install sigs.k8s.io/controller-tools/cmd/[email protected]
- name: Run Codegen
run: make codegen
- name: Git stuff
# As of go 1.20, this seems to be necessary for invoking git commands
# within the container
run: git config --global --add safe.directory /__w/kargo/kargo
- name: Check nothing has changed
run: git diff --exit-code -- .
build-image:
needs: [test-unit, lint-go, lint-charts, lint-proto, check-codegen]
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build
uses: docker/build-push-action@v3
with:
platforms: linux/amd64,linux/arm64
push: false
cache-from: type=gha
cache-to: type=gha,mode=max
build-cli:
needs: [test-unit, lint-go, lint-charts, lint-proto, check-codegen]
runs-on: ubuntu-latest
container:
image: golang:1.20.7-bookworm
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: /go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Build CLI
env:
GOFLAGS: -buildvcs=false
run: make build-cli