From 906b0e66a70e297d1f653a01e6a18d15188b2abd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1ximo=20Cuadros?= Date: Sun, 24 May 2020 05:23:37 +0200 Subject: [PATCH] ci: remove Travis in favor of GitHub Actions --- .github/workflows/docker.yml | 32 ++++++++++++++++++++++++++++++++ .github/workflows/release.yml | 23 +++++++++++++++++++++++ .github/workflows/test.yml | 28 ++++++++++++++++++++++++++++ .travis.yml | 31 ------------------------------- 4 files changed, 83 insertions(+), 31 deletions(-) create mode 100644 .github/workflows/docker.yml create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/test.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 000000000..1af696965 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,32 @@ +name: Docker Push +on: + release: + types: + - created + push: + branches: + - master +jobs: + docker: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Build image + uses: mr-smithers-excellent/docker-build-push@v2 + with: + image: mcuadros/ofelia + registry: docker.io + username: mcuadros + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Tag image + if: github.event_name == 'release' + uses: mr-smithers-excellent/docker-build-push@v2 + with: + image: mcuadros/ofelia + registry: docker.io + tag: latest + username: mcuadros + password: ${{ secrets.DOCKER_PASSWORD }} \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..4e21d0a5f --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,23 @@ +name: Release +on: + release: + types: + - created + +jobs: + release: + strategy: + fail-fast: false + matrix: + goos: [linux, windows, darwin] + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Release binaries + uses: mcuadros/go-release-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + goos: ${{ matrix.goos }} + goarch: amd64 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 000000000..05b12ff66 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,28 @@ +name: Test +on: + push: + branches: + - master + pull_request: + branches: + - master +jobs: + test: + strategy: + fail-fast: false + matrix: + go-version: [1.13.x, 1.14.x] + platform: [ubuntu-latest, macos-latest, windows-latest] + runs-on: ${{ matrix.platform }} + steps: + + - name: Install Go + uses: actions/setup-go@v1 + with: + go-version: ${{ matrix.go-version }} + + - name: Checkout code + uses: actions/checkout@v2 + + - name: Test + run: go test ./... \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index fd27b92e8..000000000 --- a/.travis.yml +++ /dev/null @@ -1,31 +0,0 @@ -language: go - -sudo: false - -go: - - 1.11.x - - 1.12.x - - 1.13.x - -env: - global: - - GO111MODULE=on - -script: - - make test-coverage - -after_success: - - bash <(curl -s https://codecov.io/bash) - -before_deploy: - - make packages - -deploy: - provider: releases - api_key: $GITHUB_TOKEN - file: - - build/ofelia_${TRAVIS_TAG}_darwin_amd64.tar.gz - - build/ofelia_${TRAVIS_TAG}_linux_amd64.tar.gz - skip_cleanup: true - on: - tags: true