Skip to content

Environment variable configuration #28

Environment variable configuration

Environment variable configuration #28

Workflow file for this run

name: Go code jobs
on:
push:
branches:
- main
pull_request:
jobs:
source_lint:
runs-on: ubuntu-latest
name: Linting Go code.
steps:
- name: Checkout code into the Go module directory.
uses: actions/checkout@v3
- name: Import environment variables from file
run: cat ".github/env" >> $GITHUB_ENV
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: '${{ env.golang-version }}'
cache: true
- name: Run source code linting.
run: make lint
go_multiarch_build:
runs-on: ubuntu-latest
name: Build for all supported archs.
steps:
- name: Checkout code into the Go module directory.
uses: actions/checkout@v3
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Cache for Docker's buildx
uses: actions/cache@v3
with:
path: .buildxcache/
key: ${{ runner.os }}-buildx-${{ hashFiles('**/*.go', 'Dockerfile', 'go.sum') }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Snapshot container buid
run: make container-build
go_build_and_test:
runs-on: ubuntu-latest
name: Build the Go Binary and run tests.
steps:
- name: Checkout code into the Go module directory.
uses: actions/checkout@v3
- name: Import environment variables from file
run: cat ".github/env" >> $GITHUB_ENV
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: '${{ env.golang-version }}'
cache: true
- name: Build the Go binary.
run: make token-refresher
- name: Check if repo is dirty.
run: git diff --exit-code
- name: Run the tests.
run: make test
build_jsonnet:
runs-on: ubuntu-latest
name: Build jsonnet files.
steps:
- name: Checkout code into the Go module directory.
uses: actions/checkout@v3
- name: Import environment variables from file
run: cat ".github/env" >> $GITHUB_ENV
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: '${{ env.golang-version }}'
cache: true
- name: Run source code linting.
run: make manifests
- name: Check if repo is dirty.
run: git diff --exit-code