Skip to content

Commit

Permalink
Merge branch 'chore/ci-runner'
Browse files Browse the repository at this point in the history
  • Loading branch information
NgoKimPhu committed Jul 26, 2024
2 parents 8349df3 + 070d1fe commit f94d8fc
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,17 @@ on:
cache:
description: 'Enable buildx caching (experimental)'
type: boolean
runs-on:
description: 'Type of machine to run the job on'
type: string
default: self-hosted

env:
IMAGE_REGISTRY: asia.gcr.io

jobs:
build:
runs-on: self-hosted
runs-on: ${{ inputs.runs-on }}
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,15 @@ name: CI

on:
workflow_call:
inputs:
runs-on:
description: 'Type of machine to run the job on'
type: string
default: ubuntu-latest

jobs:
lint:
runs-on: self-hosted
runs-on: ${{ inputs.runs-on }}
steps:
- name: Add git config for Go private module
run: git config --global url."https://${{ secrets.GH_PAT }}:x-oauth-basic@github.com/".insteadOf https://github.com/
Expand All @@ -31,7 +36,7 @@ jobs:
args: --timeout=10m

test:
runs-on: self-hosted
runs-on: ${{ inputs.runs-on }}
outputs:
cov: ${{ steps.cov.outputs.cov }}
steps:
Expand Down Expand Up @@ -59,7 +64,7 @@ jobs:
} >> $GITHUB_OUTPUT
test_base:
runs-on: self-hosted
runs-on: ${{ inputs.runs-on }}
if: github.event_name == 'pull_request'
outputs:
cov: ${{ steps.cov.outputs.cov }}
Expand Down Expand Up @@ -88,7 +93,7 @@ jobs:
} >> $GITHUB_OUTPUT
test_coverage:
runs-on: self-hosted
runs-on: ${{ inputs.runs-on }}
needs: [test, test_base]
if: github.event_name == 'pull_request' && !cancelled() && needs.test.result == 'success'
steps:
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ on:
release_body:
description: 'Custom release body'
type: string
runs-on:
description: 'Type of machine to run the job on'
type: string
default: self-hosted

jobs:
build:
Expand All @@ -43,9 +47,10 @@ jobs:
service: ${{ inputs.service }}
version: ${{ inputs.version }}
file: ${{ inputs.file }}
runs-on: ${{ inputs.runs-on }}
secrets: inherit
tag:
runs-on: self-hosted
runs-on: ${{ inputs.runs-on }}
needs: build
if: inputs.create_tag
env:
Expand Down

0 comments on commit f94d8fc

Please sign in to comment.