chore: move to GitHub Actions

This commit is contained in:
Liz Rice 2020-12-17 17:26:38 +00:00
parent 4847b323b6
commit ddfb6fd27b
4 changed files with 77 additions and 32 deletions

36
.github/workflows/build.yml vendored Normal file
View file

@ -0,0 +1,36 @@
name: build
on:
push:
branches:
- main
paths-ignore:
- "*.md"
- "LICENSE"
- "NOTICE"
pull_request:
paths-ignore:
- "*.md"
- "LICENSE"
- "NOTICE"
jobs:
build:
name: Build
runs-on: ubuntu-18.04
steps:
- name: Setup Go
uses: actions/setup-go@v1
with:
go-version: 1.13
- name: Checkout code
uses: actions/checkout@v2
- name: Run unit tests
run: make tests
- name: Upload code coverage
uses: codecov/codecov-action@v1
with:
file: ./coverage.txt
- name: Dry-run release snapshot
uses: goreleaser/goreleaser-action@v2
with:
version: v0.148.0
args: release --snapshot --skip-publish --rm-dist

29
.github/workflows/release.yml vendored Normal file
View file

@ -0,0 +1,29 @@
name: release
on:
push:
tags:
- "v*"
jobs:
release:
name: Release
runs-on: ubuntu-18.04
steps:
- name: Setup Go
uses: actions/setup-go@v1
with:
go-version: 1.13
- name: Checkout code
uses: actions/checkout@v2
- name: Run unit tests
run: make tests
- name: Upload code coverage
uses: codecov/codecov-action@v1
with:
file: ./coverage.txt
- name: Release
uses: goreleaser/goreleaser-action@v2
with:
version: v0.148.0
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View file

@ -1,28 +0,0 @@
---
language: go
notifications:
email: false
before_install:
- sudo apt-get -qq update
- sudo apt-get install -y rpm
script:
- make tests
after_success:
- bash <(curl -s https://codecov.io/bash)
deploy:
- provider: script
skip_cleanup: true
script: curl -sL https://git.io/goreleaser | bash
on:
tags: true
condition: "$TRAVIS_OS_NAME = linux"
env:
matrix:
- GO111MODULE=on

View file

@ -1,9 +1,9 @@
[![Build Status](https://travis-ci.org/aquasecurity/linux-bench.svg?branch=main)](https://travis-ci.org/aquasecurity/linux-bench)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![GitHub Release][release-img]][release]
[![License][license-img]][license]
[![Coverage Status][cov-img]][cov]
[![GitHub Build Actions][build-action-img]][actions]
[![GitHub Release Actions][release-action-img]][actions]
[cov-img]: https://codecov.io/github/aquasecurity/linux-bench/branch/main/graph/badge.svg
[cov]: https://codecov.io/github/aquasecurity/linux-bench
Linux-bench is a Go application that checks whether the Linux operating system is configured securely by running the checks documented in the CIS Distribution Independent Linux Benchmark.
@ -51,3 +51,11 @@ Where `<version>` is the version of linux cis for which the test applies.
# Contributing
We welcome PRs and issue reports.
[actions]: https://github.com/aquasecurity/linux-bench/actions
[build-action-img]: https://github.com/aquasecurity/linux-bench/workflows/build/badge.svg
[cov-img]: https://codecov.io/github/aquasecurity/linux-bench/branch/main/graph/badge.svg
[cov]: https://codecov.io/github/aquasecurity/linux-bench
[license-img]: https://img.shields.io/badge/License-Apache%202.0-blue.svg
[license]: https://opensource.org/licenses/Apache-2.0
[release-action-img]: https://github.com/aquasecurity/linux-bench/workflows/release/badge.svg