Skip to content

Commit

Permalink
move from Travis CI to GH Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
juandspy committed Oct 24, 2023
1 parent c901fae commit f71243b
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/bdd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: BDD tests

on:
- push
- pull_request

jobs:
bdd:
runs-on: ubuntu-20.04
strategy:
matrix:
go-version:
- "1.17"
name: BDD for Go ${{ matrix.go-version}}
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Build project
run: make build
- name: Retrieve Docker compose file
run: wget -O docker-compose.yml https://raw.githubusercontent.com/RedHatInsights/insights-behavioral-spec/main/docker-compose.yml
- name: Retrieve BDD runner
run: wget -O bdd_runner.sh https://raw.githubusercontent.com/RedHatInsights/insights-behavioral-spec/main/run_in_docker.sh && chmod +x bdd_runner.sh
- name: Run BDD
run: ./bdd_runner.sh exporter-tests .
30 changes: 30 additions & 0 deletions .github/workflows/gotests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Go tests

on:
- push
- pull_request

jobs:
gotests:
runs-on: ubuntu-20.04
strategy:
matrix:
go-version:
- "1.17"
- "1.18"
- "1.19"
- "1.20"
- "1.21"
name: Tests for Go ${{ matrix.go-version}}
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Unit tests
run: env
- name: Retrieve code coverage
run: go test -coverprofile coverage.out $(go list ./... | grep -v tests)
- name: Display code coverage
run: go tool cover -func=coverage.out
28 changes: 28 additions & 0 deletions .github/workflows/linters.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Go linters

on:
- push
- pull_request

jobs:
golint:
runs-on: ubuntu-20.04
strategy:
matrix:
go-version:
- "1.17"
- "1.18"
- "1.19"
- "1.20"
- "1.21"
name: Linters for Go ${{ matrix.go-version}}
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Build project
run: go build
- name: Style linters
run: make style
13 changes: 13 additions & 0 deletions .github/workflows/shellcheck.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Shell check

on:
- push
- pull_request

jobs:
shellcheck:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Shell check
run: ./shellcheck.sh

0 comments on commit f71243b

Please sign in to comment.