Skip to content

Commit

Permalink
Convert gocardless/draupnir to GitHub Actions (#490)
Browse files Browse the repository at this point in the history
* Add workflow gocardless/draupnir/build-integration

* chore: polishing valet ci output

* Pin ubuntu version to 22.04

Remove commented out build-production, it's only used once, no point in
uploading and downloading the artifact for it

* Remove circleci directory

* Improve triggers and cancel running jobs

Co-authored-by: ddumitrache <ddumitrache@gocardless.com>
  • Loading branch information
Sam Robson and ddumitrache authored Jan 12, 2023
1 parent 86227d9 commit eae1d89
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 127 deletions.
11 changes: 0 additions & 11 deletions .circleci/Dockerfile

This file was deleted.

116 changes: 0 additions & 116 deletions .circleci/config.yml

This file was deleted.

94 changes: 94 additions & 0 deletions .github/workflows/build-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: build-integration
on:
pull_request:
types: [ opened, reopened, synchronize ]

push:
branches:
- master

concurrency:
# running pipeline per workflow per PR
group: ${{ github.head_ref || github.run_id }}-${{ github.workflow }}
# Running a new pipeline will cancel any running pipelines that belong to the above group
cancel-in-progress: true

jobs:
unit:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3.1.0
- uses: actions/setup-go@v3
with:
go-version: 1.17.3
- run: make test

rubocop:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3.1.0
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- run: bundle exec rubocop

check-deps-tidy:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3.1.0
- uses: actions/setup-go@v3
with:
go-version: 1.17.3
- run: go mod tidy
- run: |
if ! git diff --exit-code -- go.mod go.sum; then
echo "Modules not tidy; please run 'go mod tidy'";
fi;
check-deps-updated:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3.1.0
- uses: actions/setup-go@v3
with:
go-version: 1.17.3
- run: go mod download
- run: env GOPROXY=off go build -mod=readonly ./...

integration:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3.1.0
- uses: actions/setup-go@v3
with:
go-version: 1.17.3
- name: Build linux binary
run: make build-production
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Run integration tests
run: make test-integration

release:
if: contains('refs/heads/master', github.ref)
needs: integration
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3.1.0
- uses: actions/setup-go@v3
with:
go-version: 1.17.3
- name: Release
run: |-
CURRENT_VERSION="v$(cat DRAUPNIR_VERSION)"
if [[ $(git tag -l "${CURRENT_VERSION}") == "${CURRENT_VERSION}" ]]; then
echo "Version ${CURRENT_VERSION} is already released"
exit 0
fi
curl -L -o /tmp/goreleaser_Linux_x86_64.tar.gz https://github.com/goreleaser/goreleaser/releases/download/v1.10.2/goreleaser_Linux_x86_64.tar.gz
tar zxf /tmp/goreleaser_Linux_x86_64.tar.gz -C /tmp
git log --pretty=oneline --abbrev-commit --no-decorate --no-color "$(git describe --tags --abbrev=0)..HEAD" -- pkg cmd vendor internal > /tmp/release-notes
git tag "${CURRENT_VERSION}"
git push --tags
/tmp/goreleaser --rm-dist --release-notes /tmp/release-notes

0 comments on commit eae1d89

Please sign in to comment.