From aef3e832f52b833c60a0f5c9e39702c0a8827324 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Wed, 14 Apr 2021 20:29:00 +0100 Subject: [PATCH] ci(github): switch from CircleCI to GitHub Actions --- .circleci/config.yml | 57 ---------------------------------------- .github/workflows/ci.yml | 38 +++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 57 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/ci.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index d89f93a..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,57 +0,0 @@ -version: 2 -jobs: - build: - docker: - - image: circleci/golang:1.16 - working_directory: /go/src/github.com/jimeh/casecmp - steps: - - checkout - - run: - name: Install dependencies - command: go mod download - - run: - name: Build binary - command: make - - run: - name: Start service - command: ./bin/casecmp --port=8080 - background: true - - run: - name: Validate service is working - command: | - curl --retry 10 --retry-delay 1 --retry-connrefused \ - http://localhost:8080/ - release: - docker: - - image: circleci/golang:1.16 - working_directory: /go/src/github.com/jimeh/casecmp - steps: - - checkout - - run: curl -sL https://git.io/goreleaser | bash - -workflows: - version: 2 - build: - jobs: - - build: - filters: - branches: - only: /.*/ - tags: - ignore: /^v[0-9]+(\.[0-9]+)*/ - build-and-release: - jobs: - - build: - filters: - branches: - ignore: /.*/ - tags: - only: /^v[0-9]+(\.[0-9]+)*/ - - release: - requires: - - build - filters: - branches: - ignore: /.*/ - tags: - only: /^v[0-9]+(\.[0-9]+)*/ diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..b04d3f8 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,38 @@ +--- +name: CI +on: [push] + +jobs: + build: + name: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-go@v2 + with: + go-version: 1.16 + - name: Install dependencies + run: go mod download + - name: Build binary + run: make + - name: Run and make request + run: | + ./bin/casecmp --port=8080 & + curl --silent --retry 10 --retry-delay 1 --retry-connrefused \ + http://localhost:8080/ + + release: + name: Release + runs-on: ubuntu-latest + needs: [build] + if: startsWith(github.ref, 'refs/tags/v') + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-go@v2 + with: + go-version: 1.16 + - name: goreleaser + uses: goreleaser/goreleaser-action@v2 + with: + version: latest + args: release --rm-dist