Skip to content

Commit

Permalink
feat: attempt at workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
knechtionscoding authored Feb 16, 2023
1 parent ea1c075 commit 9985584
Showing 1 changed file with 113 additions and 0 deletions.
113 changes: 113 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
name: CI
on:
# Enable manually triggering this workflow via the API or web UI
workflow_dispatch:
push:
branches:
- main
tags:
- v*
pull_request:

defaults:
run:
shell: bash

jobs:

lint:
runs-on: ubuntu-latest
env:
GOLANG_CI_VERSION: v1.49.0
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.18.x
- name: golangci-lint on Go
uses: golangci/golangci-lint-action@v3
with:
version: ${{ env.GOLANG_CI_VERSION }}

test-prev:
strategy:
fail-fast: false
matrix:
go-version: [1.18.x]
platform: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- name: Run tests
run: |
go version
go test -race -timeout 800s ./...
test-current:
strategy:
fail-fast: false
matrix:
go-version: [1.19.x]
platform: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
check-latest: true
- name: Run tests
run: |
go version
go test -race -timeout 800s ./...
test-build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.19.x
- name: Check build
run: |
go version
pwd && ls -l
go install go.k6.io/xk6/cmd/xk6@master
GOPRIVATE="go.k6.io/k6" xk6 build \
--output ./k6ext \
--with github.com/knechtionscoding/xk6-prometheus="."
./k6ext version
test-tip:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.x
- name: Install Go tip
run: |
go install golang.org/dl/gotip@latest
gotip download
echo "GOROOT=$HOME/sdk/gotip" >> "$GITHUB_ENV"
echo "GOPATH=$HOME/go" >> "$GITHUB_ENV"
echo "$HOME/go/bin" >> "$GITHUB_PATH"
echo "$HOME/sdk/gotip/bin" >> "$GITHUB_PATH"
- name: Run tests
run: |
which go
go version
go test -race -timeout 800s ./...

0 comments on commit 9985584

Please sign in to comment.