This repository has been archived by the owner on Apr 2, 2024. It is now read-only.
Update github actions #7013
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: Go | |
defaults: | |
run: | |
shell: bash --noprofile --norc -eo pipefail {0} | |
on: | |
push: | |
branches: [master, main, force_test, release-*, staging, trying] | |
pull_request: | |
branches: ['**'] | |
env: | |
golang-version: 1.22.1 | |
golangci-lint-version: v1.57.2 | |
jobs: | |
scripts: | |
name: Lint shell scripts | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- name: Run ShellCheck | |
run: make shellcheck | |
build: | |
name: Build and Lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v3 | |
- name: Set up Go ${{ env.golang-version }} | |
uses: actions/[email protected] | |
with: | |
go-version: ${{ env.golang-version }} | |
id: go | |
- name: Lint | |
uses: golangci/golangci-lint-action@v3 | |
with: | |
version: ${{ env.golangci-lint-version }} | |
- name: Format | |
run: | | |
make go-fmt | |
git diff --exit-code . | |
- name: Generated | |
run: | | |
make deepcopy-gen | |
git diff --exit-code . | |
- name: Build | |
run: make build | |
test: | |
name: unit | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v3 | |
- name: Checkout test data files | |
run: wget https://github.com/timescale/promscale-test-data/raw/main/traces-dataset.sz -O pkg/tests/testdata/traces-dataset.sz | |
- name: Set up Go ${{ env.golang-version }} | |
uses: actions/[email protected] | |
with: | |
go-version: ${{ env.golang-version }} | |
id: go | |
- name: Use Go module caching | |
uses: actions/cache@v3 | |
with: | |
path: ~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- name: Test | |
run: make unit > unit-run.log 2>&1 | |
- name: 'Print failure logs' | |
if: ${{ failure() }} | |
run: cat unit-run.log | |
- name: 'Upload Log Artifact' | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: unit-run.log | |
path: unit-run.log | |
retention-days: 5 | |
- name: Generated | |
run: | | |
go generate ./... | |
git diff --exit-code | |
docs: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v3 | |
- name: Set up Go ${{ env.golang-version }} | |
uses: actions/[email protected] | |
with: | |
go-version: ${{ env.golang-version }} | |
- name: download mdox | |
run: go install -a github.com/bwplotka/mdox@latest | |
- run: make check-docs |