From ddfb6fd27bb81be3abbbcde0a3af6ea3d66ffc20 Mon Sep 17 00:00:00 2001 From: Liz Rice Date: Thu, 17 Dec 2020 17:26:38 +0000 Subject: [PATCH] chore: move to GitHub Actions --- .github/workflows/build.yml | 36 +++++++++++++++++++++++++++++++++++ .github/workflows/release.yml | 29 ++++++++++++++++++++++++++++ .travis.yml | 28 --------------------------- README.md | 16 ++++++++++++---- 4 files changed, 77 insertions(+), 32 deletions(-) create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/release.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..7b502d2 --- /dev/null +++ b/.github/workflows/build.yml @@ -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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..92de2f9 --- /dev/null +++ b/.github/workflows/release.yml @@ -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 }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 77c02bb..0000000 --- a/.travis.yml +++ /dev/null @@ -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 diff --git a/README.md b/README.md index 3d27699..73921f4 100644 --- a/README.md +++ b/README.md @@ -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 `` 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