Skip to content

Merge pull request #24 from djengua/task/handlers #77

Merge pull request #24 from djengua/task/handlers

Merge pull request #24 from djengua/task/handlers #77

Workflow file for this run

name: CI Checks
on:
push:
branches:
- main
jobs:
format-check:
name: Check formatting
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v4
with:
go-version: ^1.2
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Run Format Check
run: make check-format
- name: Vet
run: make vet
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Lint
uses: golangci/golangci-lint-action@v3
test:
name: Test Application
needs:
- format-check
- lint
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.2
- name: Check out code into hte Go module directory
uses: actions/checkout@v3
- name: Run Test
run: make test
- name: Coverage Check
run: make coverage
- name: Generate Report
run: make report
- name: Copy Files
run: |
mkdir reports
cp cover.html reports/.
- name: Archive
uses: actions/upload-artifact@v2
with:
name: reports
path: reports
build:
name: Build App
runs-on: ubuntu-latest
needs: test
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.2
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Build
run: make build
- name: Copy files
run: |
mkdir artifacts
cp api artifacts/.
- name: Archive
uses: actions/upload-artifact@v2
with:
name: api
path: artifacts
deliver:
name: Release
needs: build
runs-on: ubuntu-latest
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Download binay
uses: actions/download-artifact@v2
with:
name: api
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: Still in experimentation phase
draft: true
prerelease: true
- name: Upload Release Binary
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}}
with:
upload_url: ${{steps.create_release.outputs.upload_url}}
asset_path: api
asset_name: api
asset_content_type: application/octet-stream