Set logger #850
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: test | |
on: | |
push: | |
branches: | |
- "main" | |
pull_request: | |
branches: | |
- "main" | |
jobs: | |
codegen: | |
name: Codegen | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Restore go build cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/go-build | |
key: ${{ runner.os }}-go-build-v1-${{ hashFiles('**/go.mod') }} | |
- name: Setup Golang | |
uses: actions/setup-go@v4.0.0 | |
with: | |
go-version: '1.21' | |
- name: Add bins to PATH | |
run: | | |
echo /home/runner/go/bin >> $GITHUB_PATH | |
echo /usr/local/bin >> $GITHUB_PATH | |
- name: Get dependencies | |
run: go mod download | |
- name: Make codegen | |
run: | | |
echo 'GOPATH=/home/runner/go' >> $GITHUB_ENV | |
make -B codegen | |
- name: Ensure nothing changed | |
run: git diff --exit-code | |
# TODO: reenable after GED | |
# unit-tests: | |
# name: Unit Tests | |
# runs-on: ubuntu-latest | |
# services: | |
# gitserver: | |
# image: quay.io/numaio/localgitserver | |
# ports: | |
# - 2222:22 | |
# - 8443:443 | |
# - 8080:80 | |
# timeout-minutes: 10 | |
# steps: | |
# - name: Set up Go 1.x | |
# uses: actions/setup-go@v4.0.0 | |
# with: | |
# go-version: '1.21' | |
# id: go | |
# - name: Install MockGen | |
# run: go install github.com/golang/mock/mockgen@v1.6.0 | |
# - name: Check out code into the Go module directory | |
# uses: actions/checkout@v3 | |
# - name: Restore Go build cache | |
# uses: actions/cache@v3 | |
# with: | |
# path: ~/.cache/go-build | |
# key: ${{ runner.os }}-go-build-v1-${{ github.run_id }} | |
# - name: Get dependencies | |
# run: go mod download | |
# - name: Test | |
# run: make test | |
# e2e-tests: | |
# name: E2E Tests | |
# runs-on: ubuntu-latest | |
# timeout-minutes: 20 | |
# strategy: | |
# fail-fast: false | |
# matrix: | |
# case: [e2e, kustomize-e2e, helm-e2e] | |
# steps: | |
# - name: Checkout code | |
# uses: actions/checkout@v3 | |
# - name: Restore go build cache | |
# uses: actions/cache@v3 | |
# with: | |
# path: ~/.cache/go-build | |
# key: ${{ runner.os }}-go-build-v1-${{ hashFiles('**/go.mod') }} | |
# - name: Setup Golang | |
# uses: actions/setup-go@v4.0.0 | |
# with: | |
# go-version: '1.21' | |
# - name: Add bins to PATH | |
# run: | | |
# echo /home/runner/go/bin >> $GITHUB_PATH | |
# echo /usr/local/bin >> $GITHUB_PATH | |
# - name: Install k3d | |
# run: curl -sfL https://raw.githubusercontent.com/rancher/k3d/main/install.sh | bash & | |
# - name: Create a cluster | |
# run: | | |
# k3d cluster create e2e | |
# k3d kubeconfig get e2e > ~/.kube/numaplane-e2e-config | |
# echo '127.0.0.1 localhost' | sudo tee -a /etc/hosts | |
# - name: Install Numaplane | |
# env: | |
# GOPATH: /home/runner/go | |
# run: | | |
# KUBECONFIG=~/.kube/numaplane-e2e-config VERSION=${{ github.sha }} DOCKER_PUSH=true make start | |
# - name: Run tests | |
# env: | |
# GOPATH: /home/runner/go | |
# run: KUBECONFIG=~/.kube/numaplane-e2e-config VERSION=${{ github.sha }} DOCKER_PUSH=true make test-${{matrix.case}} | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
env: | |
GOPATH: /home/runner/go | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Golang | |
uses: actions/setup-go@v4.0.0 | |
with: | |
go-version: '1.21' | |
- name: Install MockGen | |
run: go install github.com/golang/mock/mockgen@v1.6.0 | |
- name: Restore Go build cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/go-build | |
key: ${{ runner.os }}-go-build-v1-${{ github.run_id }} | |
- run: make lint | |
- run: git diff --exit-code |