diff --git a/.github/workflows/sonar.yaml b/.github/workflows/sonar.yaml new file mode 100644 index 0000000..5a2e1d3 --- /dev/null +++ b/.github/workflows/sonar.yaml @@ -0,0 +1,30 @@ +# This workflow will build a golang project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go + +name: Sonar Report + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.22' + + - name: Generate Sonar Report + run: go test -coverprofile=coverage.out -json ./... > sonar-report.json + + - name: Upload coverage reports to Sonar + uses: sonarsource/sonarcloud-github-action@master + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..664fadc --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,31 @@ +# This workflow will build a golang project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go + +name: Run Tests + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + + build: + strategy: + matrix: + go: [ '1.21', '1.22', '1' ] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: ${{ matrix.go }} + + - name: Vet + run: go vet -v ./... + + - name: Test + run: go test -v ./... diff --git a/README.md b/README.md index 2fbc70d..7ac30c4 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,36 @@
- Workflow Logo + Workflow Logo +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ ## Workflow is a Golang workflow framework that encompasses these main features: - Defining small units of work called "Steps" - Consumer management and graceful shutdown diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000..8dabef3 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,11 @@ +sonar.organization = luno +sonar.projectKey = luno_workflow +sonar.projectName = workflow +sonar.links.scm = https://github.com/luno/workflow + +sonar.sources = . +sonar.exclusions=**/*_test.go +sonar.go.coverage.reportPaths = coverage.out +sonar.go.tests.reportPaths = sonar-report.json +sonar.tests = . +sonar.test.inclusions = **/*_test.go \ No newline at end of file