build(deps): bump the go_modules group across 1 directory with 3 updates #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'app-pipeline' | ||
on: | ||
push: | ||
pull_request: | ||
jobs: | ||
test: | ||
strategy: | ||
matrix: | ||
go-version: [1.18.x] | ||
platform: [ubuntu-latest, macos-latest] | ||
runs-on: ${{ matrix.platform }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
- name: Cache Go dependencies | ||
id: cache-go-dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/go/pkg/mod/cache # Cache only essential Go modules | ||
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go-${{ matrix.go-version }}- | ||
- name: Install Go dependencies | ||
run: go mod download | ||
- name: Run Static Analysis | ||
run: make lint | ||
- name: Run Tests | ||
run: make test | ||
build-artifacts: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: '1.18.x' | ||
- name: Cache Go dependencies | ||
id: package-cache-go-dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/go/pkg/mod/cache | ||
key: ${{ runner.os }}-go-prod-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go-prod- | ||
- name: Install dependencies | ||
run: go mod download | ||
# Add a step to build or install license_serializer | ||
- name: Build license_serializer | ||
run: | | ||
mkdir -p .tmp/bin | ||
go build -o .tmp/bin/license_serializer ./path/to/license_serializer | ||
- name: Build snapshot artifacts | ||
run: make ci-build-snapshot-packages | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: artifacts | ||
path: dist | ||
test-linux-artifacts: | ||
needs: build-artifacts | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: '1.18.x' | ||
- name: Download artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: artifacts | ||
path: dist | ||
- name: Test Linux run | ||
run: make ci-test-linux-run | ||
test-mac-artifacts: | ||
needs: build-artifacts | ||
runs-on: macos-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: '1.18.x' | ||
- name: Download artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: artifacts | ||
path: dist | ||
- name: Test Darwin run | ||
run: make ci-test-mac-run | ||
test-windows-artifacts: | ||
needs: build-artifacts | ||
runs-on: windows-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: '1.18.x' | ||
- name: Download artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: artifacts | ||
path: dist | ||
- name: Test Windows run | ||
run: make ci-test-windows-run | ||
release: | ||
needs: [test, build-artifacts, test-linux-artifacts, test-mac-artifacts, test-windows-artifacts] | ||
runs-on: ubuntu-latest | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: '1.18.x' | ||
- name: Cache Go dependencies | ||
id: release-cache-go-dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/go/pkg/mod/cache | ||
key: ${{ runner.os }}-go-prod-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go-prod- | ||
- name: Install dependencies | ||
run: go mod download | ||
- name: Publish GitHub release | ||
run: make ci-release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |