Skip to content

Commit

Permalink
Modified workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
matteosz committed May 22, 2024
1 parent c01c053 commit fd853d5
Show file tree
Hide file tree
Showing 2 changed files with 127 additions and 40 deletions.
81 changes: 61 additions & 20 deletions .github/workflows/test_on_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,28 +29,33 @@ jobs:
echo "::error:: Could not start CI tests due to missing *safe PR* label."
exit 1
test:
test-mac:
needs: permission
strategy:
matrix:
platform: [macos-latest, windows-latest, ubuntu-latest, ubuntu-latest-x86]
runs-on: ${{ matrix.platform == 'ubuntu-latest-x86' && 'ubuntu-latest' || matrix.platform }}
runs-on: macos-latest
env:
DBGSYNCLOG: trace
DBGSYNCON: true
steps:
- name: Setup Alpine Linux
if: matrix.platform == 'ubuntu-latest-x86'
uses: jirutka/setup-alpine@v1
- name: Set up Go ^1.13
uses: actions/setup-go@v3
with:
arch: x86
packages: >
golang
make
git
gcc
musl-dev
go-version: ^1.13

- name: Check out code into the Go module directory
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Test without coverage
run: make test

test-windows:
needs: permission
runs-on: windows-latest
env:
DBGSYNCLOG: trace
DBGSYNCON: true
steps:
- name: Set up Go ^1.13
uses: actions/setup-go@v3
with:
Expand All @@ -60,18 +65,31 @@ jobs:
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0

- name: Test without coverage
if: matrix.platform == 'macos-latest' || matrix.platform == 'windows-latest' || matrix.platform == 'ubuntu-latest-x86'
run: make test

test-ubuntu:
needs: permission
runs-on: ubuntu-latest
env:
DBGSYNCLOG: trace
DBGSYNCON: true
steps:
- name: Set up Go ^1.13
uses: actions/setup-go@v3
with:
go-version: ^1.13

- name: Check out code into the Go module directory
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Test with coverage
if: matrix.platform == 'ubuntu-latest'
run: make coverage

- name: SonarCloud scan
if: matrix.platform == 'ubuntu-latest'
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -88,4 +106,27 @@ jobs:
-Dsonar.c.file.suffixes=-
-Dsonar.cpp.file.suffixes=-
-Dsonar.objc.file.suffixes=-
test-ubuntu-x86:
needs: permission
runs-on: ubuntu-latest
env:
DBGSYNCLOG: trace
DBGSYNCON: true
steps:
- name: Setup Alpine Linux for x86
run: |
sudo apt-get install golang make git gcc musl-dev
- name: Set up Go ^1.13 for x86
uses: actions/setup-go@v3
with:
go-version: ^1.13

- name: Check out code into the Go module directory for x86
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Test without coverage for x86
run: make test
86 changes: 66 additions & 20 deletions .github/workflows/test_on_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,34 @@ on:
branches: [ master ]

jobs:
test_and_coverage:
strategy:
matrix:
platform: [macos-latest, windows-latest, ubuntu-latest, ubuntu-latest-x86]
runs-on: ${{ matrix.platform == 'ubuntu-latest-x86' && 'ubuntu-latest' || matrix.platform }}
test-mac:
needs: permission
runs-on: macos-latest
env:
DBGSYNCLOG: trace
DBGSYNCON: true
steps:
- name: Setup Alpine Linux
if: matrix.platform == 'ubuntu-latest-x86'
uses: jirutka/setup-alpine@v1
- name: Set up Go ^1.13
uses: actions/setup-go@v3
with:
go-version: ^1.13

- name: Check out code into the Go module directory
uses: actions/checkout@v3
with:
arch: x86
packages: >
golang
make
git
gcc
musl-dev
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0

- name: Test without coverage
run: make test

test-windows:
needs: permission
runs-on: windows-latest
env:
DBGSYNCLOG: trace
DBGSYNCON: true
steps:
- name: Set up Go ^1.13
uses: actions/setup-go@v3
with:
Expand All @@ -38,15 +45,30 @@ jobs:
fetch-depth: 0

- name: Test without coverage
if: matrix.platform == 'macos-latest' || matrix.platform == 'windows-latest' || matrix.platform == 'ubuntu-latest-x86'
run: make test

test-ubuntu:
needs: permission
runs-on: ubuntu-latest
env:
DBGSYNCLOG: trace
DBGSYNCON: true
steps:
- name: Set up Go ^1.13
uses: actions/setup-go@v3
with:
go-version: ^1.13

- name: Check out code into the Go module directory
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0

- name: Test with coverage
if: matrix.platform == 'ubuntu-latest'
run: make coverage

- name: SonarCloud scan
if: matrix.platform == 'ubuntu-latest'
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -65,7 +87,31 @@ jobs:
-Dsonar.objc.file.suffixes=-
- name: Send coverage
if: matrix.platform == 'ubuntu-latest'
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: profile.cov

test-ubuntu-x86:
needs: permission
runs-on: ubuntu-latest
env:
DBGSYNCLOG: trace
DBGSYNCON: true
steps:
- name: Setup Alpine Linux for x86
run: |
sudo apt-get install golang make git gcc musl-dev
- name: Set up Go ^1.13 for x86
uses: actions/setup-go@v3
with:
go-version: ^1.13

- name: Check out code into the Go module directory for x86
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0

- name: Test without coverage for x86
run: make test

0 comments on commit fd853d5

Please sign in to comment.