Skip to content

Commit

Permalink
ci: add a pipeline
Browse files Browse the repository at this point in the history
Add the pipeline for go packages
  • Loading branch information
gibiw committed May 9, 2024
1 parent e3d9840 commit c60d085
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/gopackage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Go build

on: [ push ]

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 5
matrix:
go-version: [ '1.18', '1.19', '1.20', '1.21', '1.22' ]
changed-dir: [ "qase-api-client" ]
name: Project ${{ matrix.changed-dir }} - Go ${{ matrix.go-version }}
steps:
- uses: actions/checkout@v4

- uses: dorny/paths-filter@v3
id: filter
with:
list-files: 'shell'
filters: |
changes:
- '${{ matrix.changed-dir }}/**'
- name: Set up Go ${{ matrix.go-version }}
if: steps.filter.outputs.changes == 'true'
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}

- name: Install dependencies
if: steps.filter.outputs.changes == 'true'
run: go mod tidy
working-directory: ./${{ matrix.changed-dir }}

- name: Build
if: steps.filter.outputs.changes == 'true'
working-directory: ./${{ matrix.changed-dir }}
run: go build -v

- name: Test
if: steps.filter.outputs.changes == 'true'
working-directory: ./${{ matrix.changed-dir }}
run: go test -v ./test
51 changes: 51 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# IDE
.idea/*

# CMake
cmake-build-*/

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

### Go template
# If you prefer the allow list template instead of the deny list, see community template:
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
#
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# Dependency directories (remove the comment below to include it)
# vendor/

# Go workspace file
go.work

0 comments on commit c60d085

Please sign in to comment.