Skip to content

Commit

Permalink
Enhance Github Workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
a-hassanin committed Nov 19, 2024
1 parent 3479c0a commit 902be07
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 20 deletions.
39 changes: 21 additions & 18 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Go
name: Run Go Tests

concurrency:
group: '${{ github.workflow }}-${{ github.head_ref || github.run_id }}'
Expand All @@ -9,6 +9,9 @@ on:
pull_request:
paths:
- 'src/openstack_cpi_golang/**'
push:
branches:
- master

jobs:
go:
Expand All @@ -27,23 +30,23 @@ jobs:
with:
go-version-file: src/openstack_cpi_golang/go.mod

- name: Install golangci-lint
run: |
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
- name: Run golangci-lint
if: ${{ matrix.os != 'windows-2019' }}
uses: golangci/golangci-lint-action@v6
with:
working-directory: src/openstack_cpi_golang

- name: Run golangci-lint and tests on Windows
- name: Run golangci-lint
if: ${{ matrix.os == 'windows-2019' }}
run: |
cd src/openstack_cpi_golang
golangci-lint run
go test ./cpi/...
go test ./integration/...
uses: golangci/golangci-lint-action@v6
with:
working-directory: src/openstack_cpi_golang
args: --disable=goimports

- name: Run golangci-lint and tests on non-Windows
if: ${{ matrix.os != 'windows-2019' }}
run: |
cd src/openstack_cpi_golang
golangci-lint run --enable goimports
go test ./cpi/...
go test ./integration/...
shell: bash
- name: Run unit tests
run: scripts/run-unit-tests
working-directory: src/openstack_cpi_golang

- name: Run integration tests
run: scripts/run-integration-tests
working-directory: src/openstack_cpi_golang
16 changes: 14 additions & 2 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
name: Run Specs
on: [ push, pull_request ]
name: Run Ruby Specs

concurrency:
group: '${{ github.workflow }}-${{ github.head_ref || github.run_id }}'
cancel-in-progress: true

on:
workflow_dispatch:
pull_request:
paths:
- 'src/bosh_openstack_cpi/**'
push:
branches:
- master

jobs:
unit_specs:
Expand Down
7 changes: 7 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# https://golangci-lint.run/usage/configuration/
run:
timeout: 3m # 1m default times out on github-action runners

output:
# Sort results by: filepath, line and column.
sort-results: true

0 comments on commit 902be07

Please sign in to comment.