зеркало из https://github.com/microsoft/abstrakt.git
107 строки
2.3 KiB
YAML
107 строки
2.3 KiB
YAML
name: build
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
paths-ignore:
|
|
- '**.md'
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
paths-ignore:
|
|
- '**.md'
|
|
|
|
env:
|
|
GOVER: 1.14.0
|
|
|
|
jobs:
|
|
lint:
|
|
name: 'lint abstrakt'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: 'install go ${{ env.GOVER }}'
|
|
uses: actions/setup-go@v2
|
|
with:
|
|
go-version: ${{ env.GOVER }}
|
|
|
|
- name: 'checkout'
|
|
uses: actions/checkout@v2
|
|
|
|
- name: 'set GOPATH'
|
|
run: |
|
|
echo "GOPATH=$(dirname $GITHUB_WORKSPACE)" >> $GITHUB_ENV
|
|
shell: bash
|
|
|
|
- name: 'install and run lint'
|
|
uses: golangci/golangci-lint-action@v2
|
|
with:
|
|
version: v1.29
|
|
|
|
- name: 'run vet'
|
|
run: make vet
|
|
|
|
test:
|
|
name: 'test - ${{ matrix.platform }} w/ go ${{ matrix.go-version }}'
|
|
runs-on: ${{ matrix.platform }}
|
|
strategy:
|
|
matrix:
|
|
go-version: [1.13.x, 1.14.x]
|
|
platform: [ubuntu-latest, macos-latest, windows-latest]
|
|
target_arch: [arm64]
|
|
steps:
|
|
- name: 'install go ${{ matrix.go-version }}'
|
|
if: success()
|
|
uses: actions/setup-go@v2
|
|
with:
|
|
go-version: ${{ matrix.go-version }}
|
|
|
|
- name: 'checkout'
|
|
uses: actions/checkout@v2
|
|
|
|
- name: 'set GOPATH'
|
|
run: |
|
|
echo "GOPATH=$(dirname $GITHUB_WORKSPACE)" >> $GITHUB_ENV
|
|
shell: bash
|
|
|
|
- name: 'build abstrakt'
|
|
run: make build
|
|
|
|
- name: 'install dependencies'
|
|
run: make test-prepare
|
|
|
|
- name: 'test abstrakt'
|
|
run: make test
|
|
|
|
release:
|
|
name: 'release abstrakt'
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
|
runs-on: ubuntu-latest
|
|
needs: [lint, test]
|
|
steps:
|
|
- name: 'setup node.js'
|
|
uses: actions/setup-node@v2
|
|
with:
|
|
node-version: 12
|
|
|
|
- name: 'install go ${{ env.GOVER }}'
|
|
uses: actions/setup-go@v2
|
|
with:
|
|
go-version: ${{ env.GOVER }}
|
|
|
|
- name: 'checkout'
|
|
uses: actions/checkout@v2
|
|
|
|
- name: 'set GOPATH'
|
|
run: |
|
|
echo "GOPATH=$(dirname $GITHUB_WORKSPACE)" >> $GITHUB_ENV
|
|
shell: bash
|
|
|
|
- name: 'install dependencies'
|
|
run: npm ci
|
|
|
|
- name: 'generate semantic version'
|
|
run: npx semantic-release
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE }}
|