Skip to content

Commit

Permalink
ci(workflows): add docker-buildx setup step for non-ubuntu runners
Browse files Browse the repository at this point in the history
  • Loading branch information
bartventer committed Apr 8, 2024
1 parent 89028ff commit 0c9d464
Showing 1 changed file with 72 additions and 64 deletions.
136 changes: 72 additions & 64 deletions .github/workflows/default.yml
Original file line number Diff line number Diff line change
@@ -1,73 +1,81 @@
name: Build

on:
push:
branches: [ master ]
pull_request:
push:
branches: [master]
pull_request:

jobs:
build:
name: Build
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
go-version: [1.21.x, 1.22.x]

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
build:
name: Build
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
go-version: [1.21.x, 1.22.x]
include:
- os: ubuntu-latest
skip-docker-setup: true

- name: Build
shell: bash
run: make build
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}

- name: Test and Coverage
shell: bash
run: make cover

- name: Coveralls
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: ./cover.out
- name: Build
shell: bash
run: make build

license-scan:
name: License scan
runs-on: ubuntu-latest
if: github.event_name == 'push'
needs: [build]
steps:
- uses: actions/checkout@v4
- name: Install FOSSA
run: |
curl -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/fossas/fossa-cli/master/install-latest.sh | bash
- name: Run FOSSA analysis
env:
FOSSA_API_KEY: ${{ secrets.FOSSA_API_KEY }}
run: fossa analyze
- name: Set up Docker Buildx
if: matrix.skip-docker-setup != 'true'
uses: docker/setup-buildx-action@v3

- name: Check FOSSA status
env:
FOSSA_API_KEY: ${{ secrets.FOSSA_API_KEY }}
run: fossa test

semantic-release:
name: Semantic Release
needs: [license-scan]
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
steps:
- uses: actions/checkout@v4
- name: Run semantic-release
if: github.repository == 'bartventer/gorm-multitenancy' && github.event_name == 'push'
run: |
yarn global add semantic-release@17
semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Test and Coverage
shell: bash
run: make cover

- name: Coveralls
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: ./cover.out

license-scan:
name: License scan
runs-on: ubuntu-latest
if: github.event_name == 'push'
needs: [build]
steps:
- uses: actions/checkout@v4
- name: Install FOSSA
run: |
curl -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/fossas/fossa-cli/master/install-latest.sh | bash
- name: Run FOSSA analysis
env:
FOSSA_API_KEY: ${{ secrets.FOSSA_API_KEY }}
run: fossa analyze

- name: Check FOSSA status
env:
FOSSA_API_KEY: ${{ secrets.FOSSA_API_KEY }}
run: fossa test

semantic-release:
name: Semantic Release
runs-on: ubuntu-latest
needs: [license-scan]
if: github.event_name == 'push'
permissions:
contents: write
issues: write
steps:
- uses: actions/checkout@v4
- name: Run semantic-release
run: |
yarn global add semantic-release@17
semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 0c9d464

Please sign in to comment.