Skip to content

Commit

Permalink
chore(ci): simplify CI config (#164)
Browse files Browse the repository at this point in the history
Build against two most recent stable golang releases, to match their
release policy.
  • Loading branch information
mccutchen authored Feb 6, 2024
1 parent b292fe6 commit f0f7d56
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 94 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: ci

on:
push:
branches: [main] # pushes TO main
pull_request:
branches: [main] # pull requests AGAINST main

# cancel CI runs when a new commit is pushed to any branch except main
concurrency:
group: "test-${{ github.ref }}"
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
test:
runs-on: ubuntu-latest

strategy:
matrix:
# build against the two latest releases, to match golang's release
# policy: https://go.dev/doc/devel/release#policy
go-version:
- 'stable'
- 'oldstable'

steps:
- uses: actions/setup-go@v5
with:
go-version: ${{matrix.go-version}}

- uses: actions/checkout@v4

- name: test
run: make testci

- uses: codecov/codecov-action@v3
with:
files: ./coverage.out
if: ${{ matrix.go-version == 'stable' }}

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version: 'stable'

- uses: golangci/golangci-lint-action@v3
with:
version: latest
25 changes: 0 additions & 25 deletions .github/workflows/lint.yaml

This file was deleted.

20 changes: 7 additions & 13 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,24 @@ jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- uses: docker/setup-buildx-action@v2

- name: Login to Docker Hub
uses: docker/login-action@v2
- uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v4
- uses: docker/metadata-action@v4
with:
images: |
mccutchen/go-httpbin
id: meta

- name: Build and push
uses: docker/build-push-action@v3
- uses: docker/build-push-action@v3
with:
platforms: linux/amd64,linux/arm64
push: true
Expand Down
56 changes: 0 additions & 56 deletions .github/workflows/test.yaml

This file was deleted.

0 comments on commit f0f7d56

Please sign in to comment.