Skip to content

Commit

Permalink
Merge pull request #247 from symflower/reuse-action-workflows
Browse files Browse the repository at this point in the history
Run docker image generation on each Push
  • Loading branch information
bauersimon authored Jul 8, 2024
2 parents 460d779 + b290a8e commit 3d4b410
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 31 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: CI

on:
push:
branches: ['main']
pull_request:
branches: ['main']

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
docker:
name: 'Run docker image building'
uses: ./.github/workflows/docker.yml
test:
name: 'Run tests and linting'
strategy:
fail-fast: false # Run the whole matrix for maximum information, no matter if we fail in one entry early
matrix:
os:
- 'macOS-latest'
- 'ubuntu-latest'
- 'windows-latest'
uses: ./.github/workflows/test.yml
with:
os: ${{ matrix.os }}
needs: docker
13 changes: 3 additions & 10 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
name: docker image

on:
push:
release:
types: [released]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
workflow_call:

jobs:
docker:
Expand All @@ -32,10 +24,11 @@ jobs:
images: |
ghcr.io/symflower/eval-dev-quality
tags: |
type=raw,value={{ sha }}
type=raw,value={{ branch }}
type=raw,value=latest,enable={{ is_default_branch }}
- name: Build and push
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: ./
platforms: linux/amd64
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Release

on:
release:
types: [released]

jobs:
docker:
uses: ./.github/workflows/docker.yml
28 changes: 7 additions & 21 deletions .github/workflows/go.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,12 @@
name: CI

on:
push:
branches: ['main']
pull_request:
branches: ['main']

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

workflow_call:
inputs:
os:
required: true
type: string
jobs:
ci:
name: 'Run CI'
strategy:
fail-fast: false # Run the whole matrix for maximum information, no matter if we fail in one entry early
matrix:
os:
- 'macOS-latest'
- 'ubuntu-latest'
- 'windows-latest'
runs-on: ${{ matrix.os }}
test:
runs-on: ${{ inputs.os }}
steps:
- uses: actions/checkout@v4

Expand Down

0 comments on commit 3d4b410

Please sign in to comment.