forked from TrueCloudLab/frostfs-http-gw
workflows: add build/lint workflows
This commit is contained in:
parent
0995dda595
commit
df43caa951
1 changed files with 81 additions and 0 deletions
81
.github/workflows/builds.yml
vendored
Normal file
81
.github/workflows/builds.yml
vendored
Normal file
|
@ -0,0 +1,81 @@
|
||||||
|
name: Builds and lints
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
types: [opened, synchronize]
|
||||||
|
paths-ignore:
|
||||||
|
- '**/*.md'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lint:
|
||||||
|
name: Lint
|
||||||
|
runs-on: ubuntu-18.04
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: golangci-lint
|
||||||
|
uses: golangci/golangci-lint-action@v2
|
||||||
|
with:
|
||||||
|
version: latest
|
||||||
|
|
||||||
|
build_cli:
|
||||||
|
name: Build CLI
|
||||||
|
runs-on: ubuntu-18.04
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Setup Go
|
||||||
|
uses: actions/setup-go@v2
|
||||||
|
with:
|
||||||
|
go-version: 1.16
|
||||||
|
|
||||||
|
- name: Restore Go modules from cache
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: /home/runner/go/pkg/mod
|
||||||
|
key: deps-${{ hashFiles('go.sum') }}
|
||||||
|
|
||||||
|
- name: Update Go modules
|
||||||
|
run: make dep
|
||||||
|
|
||||||
|
- name: Build CLI
|
||||||
|
run: make
|
||||||
|
|
||||||
|
- name: Save binary
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: neofs-http-gw
|
||||||
|
path: bin/neofs-http-gw
|
||||||
|
|
||||||
|
build_image:
|
||||||
|
needs: build_cli
|
||||||
|
name: Build Docker image
|
||||||
|
runs-on: ubuntu-18.04
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Set up Go
|
||||||
|
uses: actions/setup-go@v2
|
||||||
|
with:
|
||||||
|
go-version: 1.16
|
||||||
|
|
||||||
|
- name: Restore Go modules from cache
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: /home/runner/go/pkg/mod
|
||||||
|
key: deps-${{ hashFiles('go.sum') }}
|
||||||
|
|
||||||
|
- name: Update Go modules
|
||||||
|
run: make dep
|
||||||
|
|
||||||
|
- name: Build Docker image
|
||||||
|
run: make image
|
Loading…
Reference in a new issue