Skip to content

Commit

Permalink
Fix promxy-operator build
Browse files Browse the repository at this point in the history
  • Loading branch information
gmlexx committed Jan 22, 2025
1 parent cfe30d1 commit b67becc
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,5 @@ jobs:
uses: helm/[email protected]
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
CR_SKIP_EXISTING: true
CR_SKIP_EXISTING: true

Original file line number Diff line number Diff line change
@@ -1,20 +1,10 @@
name: promxy-operator-build
name: promxy-operator-release
on:
pull_request_target:
types:
- labeled
- opened
- synchronize
- reopened
branches:
- main
- release-*
paths:
- "promxy-operator/**"
- "!**.md"
push:
tags:
- "*"
branches:
- main

env:
GO_VERSION: "1.22"
Expand All @@ -28,24 +18,12 @@ jobs:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.vars.outputs.version }}
pr: ${{ steps.pr.outputs.result }}
permissions:
packages: write
steps:
- name: Get PR ref
uses: actions/github-script@v7
id: pr
with:
script: |
const { data: pullRequest } = await github.rest.pulls.get({
...context.repo,
pull_number: context.payload.pull_request.number,
});
return pullRequest
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{fromJSON(steps.pr.outputs.result).merge_commit_sha}}
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v5
Expand Down
55 changes: 55 additions & 0 deletions .github/workflows/test_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: promxy-operator-build
on:
pull_request_target:
types:
- labeled
- opened
- synchronize
- reopened
branches:
- main
- release-*
paths:
- "promxy-operator/**"
- "!**.md"

env:
GO_VERSION: "1.22"

jobs:
build:
concurrency:
group: build-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
name: Build and Unit Test
runs-on: ubuntu-latest
outputs:
version: ${{ steps.vars.outputs.version }}
pr: ${{ steps.pr.outputs.result }}
permissions:
packages: write
steps:
- name: Get PR ref
uses: actions/github-script@v7
id: pr
with:
script: |
const { data: pullRequest } = await github.rest.pulls.get({
...context.repo,
pull_number: context.payload.pull_request.number,
});
return pullRequest
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{fromJSON(steps.pr.outputs.result).merge_commit_sha}}
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: false
- name: Unit tests
working-directory: ./promxy-operator
run: |
make test

0 comments on commit b67becc

Please sign in to comment.