Merge pull request #6 from nealajpatel/update-golangci-lint-option #8
This file contains hidden or 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: "CI" | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
lint: | |
permissions: | |
contents: read | |
pull-requests: read | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/setup-go@v5 | |
- uses: actions/checkout@v4 | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v5 | |
with: | |
version: latest | |
test: | |
needs: lint | |
strategy: | |
matrix: | |
go-version: [1.22.x] | |
platform: [ubuntu-latest, macos-latest, windows-latest] | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Test | |
run: make test | |
build-multiarch: | |
needs: test | |
env: | |
IMAGE_NAME: golang-rest-api-starter | |
IMAGE_TAG: latest | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
steps: | |
# Checkout buildah action github repository | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install qemu dependency | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y qemu-user-static | |
- name: Build Image | |
id: build_image_multiarch | |
uses: redhat-actions/buildah-build@v2 | |
with: | |
image: ${{ env.IMAGE_NAME }} | |
tags: latest v1 | |
archs: amd64, arm64 | |
containerfiles: | | |
./Dockerfile | |
- name: Echo Outputs | |
run: | | |
echo "Image: ${{ steps.build_image_multiarch.outputs.image }}" | |
echo "Tags: ${{ steps.build_image_multiarch.outputs.tags }}" | |
echo "Tagged Image: ${{ steps.build_image_multiarch.outputs.image-with-tag }}" | |
- name: Check images created | |
run: buildah images | grep '${{ env.IMAGE_NAME }}' | |
- name: Check manifest | |
run: | | |
set -x | |
buildah manifest inspect ${{ steps.build_image_multiarch.outputs.image }}:${{ env.IMAGE_TAG }} |