ci: Adds ci to gh actions #3
This file contains hidden or 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, rhobs-obs-api-konflux] | |
| pull_request: | |
| branches: [main, rhobs-obs-api-konflux] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.24' | |
| - name: Build | |
| run: | | |
| make build | |
| git diff --exit-code | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.24' | |
| - name: Install system dependencies | |
| run: sudo apt-get update && sudo apt-get install -y xz-utils unzip shellcheck | |
| - name: Install bingo | |
| run: go install github.com/bwplotka/bingo@latest | |
| - name: Lint | |
| run: make lint --always-make | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.24' | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update && sudo apt-get -y install xz-utils unzip openssl | |
| - name: Test | |
| run: make test --always-make | |
| test-e2e: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.24' | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Install system dependencies | |
| run: sudo apt-get update && sudo apt-get install -y make | |
| - name: End-to-end tests | |
| run: OCI_BIN=docker make test-e2e | |
| generate: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.24' | |
| - name: Install system dependencies | |
| run: sudo apt-get update && sudo apt-get -y install unzip | |
| - name: Install bingo | |
| run: go install github.com/bwplotka/bingo@latest | |
| - name: Generate and validate | |
| run: | | |
| make generate validate --always-make | |
| make proto | |
| git diff --exit-code |