Skip to content

Commit

Permalink
ci(perf): skip unnecessary golang/python installs
Browse files Browse the repository at this point in the history
  • Loading branch information
the-wondersmith committed Aug 20, 2024
1 parent ee7788c commit 537dbee
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
15 changes: 15 additions & 0 deletions .github/actions/setup-deps/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@
name: setup-deps
description: Install Go and Python

inputs:
install-golang:
description: |
Install Go
required: false
default: "true"
install-python:
description: |
Install Python
required: false
default: "true"

runs:
using: composite
steps:
Expand Down Expand Up @@ -51,19 +63,22 @@ runs:
helm plugin install https://github.com/chartmuseum/helm-push
fi
- name: Install Go
if: ${{ inputs.install-golang == 'true' }}
uses: actions/setup-go@v5
env:
DEBIAN_FRONTEND: noninteractive
with:
go-version-file: go.mod
- name: Install 'uv'
shell: bash
if: ${{ inputs.install-python == 'true' }}
env:
DEBIAN_FRONTEND: noninteractive
run: |
curl -LsSf https://astral.sh/uv/install.sh | bash
- name: Install Python Requirements
shell: bash
if: ${{ inputs.install-python == 'true' }}
env:
DEBIAN_FRONTEND: noninteractive
run: |
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
run: |
make lint
- name: Collect Job Logs
uses: ./.github/actions/after-job
uses: ./.github/actions/collect-logs
if: always()

gotest: ######################################################################
Expand All @@ -45,12 +45,14 @@ jobs:
fetch-depth: 0
- name: Install Deps
uses: ./.github/actions/setup-deps
with:
install-python: "false"
- name: Run Golang Unit Tests
shell: bash
run: |
make gotest
- name: Collect Job Logs
uses: ./.github/actions/after-job
uses: ./.github/actions/collect-logs
if: always()

pytest: ######################################################################
Expand All @@ -65,6 +67,8 @@ jobs:
fetch-depth: 0
- name: Install Deps
uses: ./.github/actions/setup-deps
with:
install-golang: "false"
- name: Create Python Virtual Env
shell: bash
run: >-
Expand All @@ -75,7 +79,7 @@ jobs:
run: |
make pytest-unit-tests
- name: Collect Job Logs
uses: ./.github/actions/after-job
uses: ./.github/actions/collect-logs
if: always()

build: #######################################################################
Expand Down Expand Up @@ -108,7 +112,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
goreleaser build --snapshot --clean
- name: Collect Job Logs
- name: Post-Build Cleanup
uses: ./.github/actions/after-job
if: always()

Expand Down

0 comments on commit 537dbee

Please sign in to comment.