Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

Update github actions (major) #7003

Update github actions (major)

Update github actions (major) #7003

Workflow file for this run

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.19.4
golangci-lint-version: v1.50.1
jobs:
scripts:
name: Lint shell scripts
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- 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@v4
- name: Set up Go ${{ env.golang-version }}
uses: actions/setup-go@v5.0.0
with:
go-version: ${{ env.golang-version }}
id: go
- name: Lint
uses: golangci/golangci-lint-action@v4
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@v4
- 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/setup-go@v5.0.0
with:
go-version: ${{ env.golang-version }}
id: go
- name: Use Go module caching
uses: actions/cache@v4
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@v4
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@v4
- name: Set up Go ${{ env.golang-version }}
uses: actions/setup-go@v5.0.0
with:
go-version: ${{ env.golang-version }}
- name: download mdox
run: go install -a github.com/bwplotka/mdox@latest
- run: make check-docs