chore(options): don't panic when 'nil' is passed as an option #133
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: Push | |
on: | |
push: | |
branches: | |
- main | |
# HINT(lukasmalkmus): Make sure the workflow is only ever run once for each | |
# commit that has been pushed. | |
concurrency: | |
group: ${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
gen-diff: | |
name: Codegen diff | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
go: | |
- "1.19" | |
- "1.20" | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ matrix.go }} | |
- run: make generate | |
- run: git diff --exit-code | |
lint: | |
name: Lint | |
needs: gen-diff | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
go: | |
- "1.19" | |
- "1.20" | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ matrix.go }} | |
cache: false | |
- run: echo "GOLANGCI_LINT_VERSION=$(go list -m -f '{{.Version}}' github.com/golangci/golangci-lint)" >> $GITHUB_ENV | |
- uses: golangci/golangci-lint-action@v3 | |
with: | |
version: ${{ env.GOLANGCI_LINT_VERSION }} | |
test: | |
name: Test | |
needs: lint | |
runs-on: ubuntu-latest | |
# HINT(lukasmalkmus): Make sure the job is only ever run once per | |
# environment, across all active jobs and workflows. Errors on the | |
# development environment will not cancel the matrix jobs on the staging | |
# environment (and thus not affect the overall workflow status). | |
concurrency: | |
group: ${{ matrix.environment }} | |
cancel-in-progress: false | |
continue-on-error: ${{ matrix.environment == 'development' }} | |
strategy: | |
fail-fast: true | |
matrix: | |
go: | |
- "1.19" | |
- "1.20" | |
environment: | |
- development | |
- staging | |
include: | |
- environment: development | |
secret_slug: DEV | |
- environment: staging | |
secret_slug: STAGING | |
env: | |
AXIOM_URL: ${{ secrets[format('TESTING_{0}_API_URL', matrix.secret_slug)] }} | |
AXIOM_TOKEN: ${{ secrets[format('TESTING_{0}_TOKEN', matrix.secret_slug)] }} | |
AXIOM_ORG_ID: ${{ secrets[format('TESTING_{0}_ORG_ID', matrix.secret_slug)] }} | |
AXIOM_DATASET_SUFFIX: ${{ github.run_id }}-${{ matrix.go }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ matrix.go }} | |
- run: make test-integration | |
- name: Cleanup (On Test Failure) | |
if: failure() | |
run: | | |
curl -sL $(curl -s https://api.github.com/repos/axiomhq/cli/releases/tags/v0.10.0 | grep "http.*linux_amd64.tar.gz" | awk '{print $2}' | sed 's|[\"\,]*||g') | tar xzvf - --strip-components=1 --wildcards -C /usr/local/bin "axiom_*_linux_amd64/axiom" | |
axiom dataset list -f=json | jq '.[] | select(.id | contains("${{ github.run_id }}-${{ matrix.go }}")).id' | xargs -r -n1 axiom dataset delete -f |