Skip to content

fix(exec): remove doubled "exec:" prefix in command-not-found error (… #56

fix(exec): remove doubled "exec:" prefix in command-not-found error (…

fix(exec): remove doubled "exec:" prefix in command-not-found error (… #56

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
with:
go-version-file: go.mod
cache: true
cache-dependency-path: "**/go.sum"
- name: Install buf
uses: bufbuild/buf-action@v1
with:
setup_only: true
- name: Generate proto
run: buf generate
- name: golangci-lint
run: cd tools && go install github.com/golangci/golangci-lint/cmd/golangci-lint && cd .. && golangci-lint run --timeout 5m
- name: go vet
run: go vet ./...
- name: gofmt check
run: |
if [ -n "$(gofmt -l .)" ]; then
echo "The following files are not gofmt'd:"
gofmt -l .
exit 1
fi
test:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
with:
go-version-file: go.mod
cache: true
- name: Install buf
uses: bufbuild/buf-action@v1
with:
setup_only: true
- name: Generate proto
run: buf generate
- name: Run unit tests
run: go test ./... -short -race -count=1 -coverprofile=coverage.txt
- name: Upload coverage
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
with:
files: coverage.txt
continue-on-error: true # don't fail CI if codecov is unavailable
proto-lint:
name: Proto Lint
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write # required for buf-action to post lint/breaking summaries as PR comments
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: bufbuild/buf-action@v1
with:
lint: true
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
include:
- goos: linux
goarch: amd64
- goos: linux
goarch: arm64
- goos: darwin
goarch: amd64
- goos: darwin
goarch: arm64
- goos: windows
goarch: amd64
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
with:
go-version-file: go.mod
cache: true
- name: Install buf
uses: bufbuild/buf-action@v1
with:
setup_only: true
- name: Generate proto
run: buf generate
- name: Build CLI
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: "0"
run: go build -o /dev/null ./cmd/jitsudo
- name: Build server
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: "0"
run: go build -o /dev/null ./cmd/jitsudod
helm:
name: Helm Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Set up Helm
uses: azure/setup-helm@v4
- name: Helm dependency update
run: helm dependency update helm/jitsudo
- name: Helm lint
run: helm lint helm/jitsudo --set config.auth.oidcIssuer=https://example.com
- name: Helm template (dry-run)
run: helm template jitsudo helm/jitsudo --set config.auth.oidcIssuer=https://example.com > /dev/null
integration:
name: Integration Tests
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_USER: jitsudo
POSTGRES_PASSWORD: jitsudo
POSTGRES_DB: jitsudo
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
localstack:
image: localstack/localstack:3
ports:
- 4566:4566
env:
SERVICES: sts,iam
options: >-
--health-cmd "curl -sf http://localhost:4566/_localstack/health"
--health-interval 10s
--health-timeout 5s
--health-retries 10
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
with:
go-version-file: go.mod
cache: true
- name: Install buf
uses: bufbuild/buf-action@v1
with:
setup_only: true
- name: Generate proto
run: buf generate
- name: Start dex (OIDC provider)
run: |
docker run -d --name dex --network host \
-v ${{ github.workspace }}/deploy/dex-config.yaml:/etc/dex/config.yaml \
ghcr.io/dexidp/dex:v2.42.0 dex serve /etc/dex/config.yaml
for i in $(seq 1 30); do
curl -sf http://localhost:5556/dex/.well-known/openid-configuration > /dev/null && break
sleep 1
done
- name: Run integration tests
env:
TEST_DATABASE_URL: postgres://jitsudo:jitsudo@localhost:5432/jitsudo?sslmode=disable
JITSUDOD_DATABASE_URL: postgres://jitsudo:jitsudo@localhost:5432/jitsudo?sslmode=disable
JITSUDOD_OIDC_ISSUER: http://localhost:5556/dex
AWS_ENDPOINT_URL: http://localhost:4566
AWS_ACCESS_KEY_ID: test
AWS_SECRET_ACCESS_KEY: test
AWS_DEFAULT_REGION: us-east-1
run: go test ./... -tags integration -race -count=1