Bleve #593
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: Check pull request | |
on: pull_request | |
env: | |
NAME: nais-api | |
IMAGE_REPOSITORY: oci://europe-north1-docker.pkg.dev/nais-io/nais | |
jobs: | |
test: | |
name: Check pull request | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: docker compose up bigquery -d | |
- uses: jdx/mise-action@v2 | |
- name: Find go cache dir | |
id: go-cache | |
run: | | |
go version | |
# Clear cache dirs to avoid error when restoring | |
go clean -cache -modcache | |
echo "gocache=$(go env GOCACHE)" >> $GITHUB_OUTPUT | |
echo "gomodcache=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT | |
- name: Cache go modules | |
uses: actions/cache@v4 | |
with: | |
path: | | |
${{ steps.go-cache.outputs.gocache }} | |
${{ steps.go-cache.outputs.gomodcache }} | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
- run: mise run test | |
- run: helm lint --strict ./charts | |
- run: mise run check:staticcheck | |
- run: mise run check:vulncheck | |
- name: Check code format and run code generators | |
run: | | |
mise run fmt ::: generate | |
git diff --exit-code --name-only | |
build_push: | |
outputs: | |
version: ${{ steps.build-push-sign.outputs.version }} | |
permissions: | |
contents: read | |
id-token: write | |
name: Build and push | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: jdx/mise-action@v2 | |
with: | |
cache_key_prefix: "pr_bp_" | |
- id: go_version | |
run: echo "go_version=$(mise current go)" >> $GITHUB_OUTPUT | |
- uses: nais/platform-build-push-sign@main | |
id: build-push-sign | |
with: | |
name: nais-api | |
build_args: | | |
GO_VERSION=${{ steps.go_version.outputs.go_version }}- | |
google_service_account: gh-api | |
workload_identity_provider: ${{ secrets.NAIS_IO_WORKLOAD_IDENTITY_PROVIDER }} | |
push: true | |
- name: Build Chart | |
run: |- | |
sed -i "s/^version: .*/version: ${{ steps.build-push-sign.outputs.version }}/g" charts/Chart.yaml | |
cat charts/Chart.yaml | |
helm package charts | |
- name: Push Chart | |
run: |- | |
helm push ${{ env.NAME }}*.tgz ${{ env.IMAGE_REPOSITORY }} |