Skip to content

Commit

Permalink
Fix codecovergae reporting
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Doherty <[email protected]>
  • Loading branch information
chrisdoherty4 committed Apr 30, 2024
1 parent b40ae66 commit 6f5baf5
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
workflow_dispatch: {}
env:
CGO_ENABLED: "0"
GO_VERSION: "1.21"
GO_VERSION: "1.22"
jobs:
verify:
name: Verify
Expand All @@ -25,26 +25,37 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 5

- uses: actions/setup-go@v5
with:
go-version: "${{ env.GO_VERSION }}"
- name: Run unit tests
run: make test

- name: Run e2e tests
run: make e2e-test

- name: Upload codecov
run: bash <(curl -s https://codecov.io/bash)
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

checks:
name: CI Checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install nix
uses: cachix/install-nix-action@v26
with:
nix_path: nixpkgs=channel:nixos-unstable

- name: Run ci-checks.sh
run: nix-shell --run 'make ci-checks'

# We preemptively build the binaries for efficiency instead of waiting on unit tests to pass
# hence this doesn't depend on anything.
build:
Expand All @@ -55,15 +66,18 @@ jobs:
platform: [amd64, arm64]
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version: "${{ env.GO_VERSION }}"
- name: Build linux/${{ matrix.platform }}
run: make build -j$(nproc) GOOS=linux GOARCH=${{ matrix.platform }}

- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.platform }}-binaries
path: bin/*

package:
name: Package
runs-on: ubuntu-latest
Expand All @@ -85,26 +99,32 @@ jobs:
- name: Create docker image tags
id: docker-image-tag
run: echo ::set-output name=tags::${{ matrix.repository }}:latest,${{ matrix.repository }}:sha-${GITHUB_SHA::8}

- uses: actions/checkout@v4

- name: Login to quay.io
uses: docker/login-action@v3
if: ${{ startsWith(github.ref, 'refs/heads/main') }}
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}

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

- name: Download all binaries
uses: actions/download-artifact@v4
with:
path: ./bin
merge-multiple: true

# Artifact upload doesn't preserve permissions so we need to fix them before use in
# the Dockerfiles.
- name: Fix permissions
run: chmod +x bin/*
- name: Build ${{ matrix.repository }} and push

uses: docker/build-push-action@v5
with:
context: .
Expand Down

0 comments on commit 6f5baf5

Please sign in to comment.