Skip to content

Commit 1fe01f9

Browse files
committed
Kjører validate nå direkte på PR
1 parent 6381d3b commit 1fe01f9

File tree

1 file changed

+44
-11
lines changed

1 file changed

+44
-11
lines changed

.github/workflows/validatePackageChanges.yml renamed to .github/workflows/validatePackageChangesOnPr.yml

Lines changed: 44 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
name: "Validate package changes"
1+
name: "[PR] Validate package changes"
22
on:
3+
pull_request:
34
workflow_call:
45
secrets:
56
SF_DEVHUB_URL:
@@ -8,8 +9,15 @@ on:
89
concurrency:
910
group: ${{ github.workflow }}-${{ github.ref_name }}
1011
jobs:
12+
staticCodeValidation:
13+
name: Validation jobs
14+
uses: navikt/sf-platform/.github/workflows/ciStaticCodeValidation.yml@main
15+
permissions:
16+
contents: read
17+
1118
checkChanges:
1219
name: Check changes
20+
needs: staticCodeValidation
1321
runs-on: ubuntu-latest
1422
outputs:
1523
hasSrcChanges: ${{ steps.checkChanges.outputs.hasSrcChanges }}
@@ -33,7 +41,6 @@ jobs:
3341
container: ghcr.io/flxbl-io/sfp:${{ vars.SFP_CONTAINER_VERSION }}
3442
permissions:
3543
contents: read
36-
packages: write
3744
steps:
3845
- name: "Checkout"
3946
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
@@ -49,17 +56,43 @@ jobs:
4956
setDefaultDevhubUsername: "true"
5057

5158
- name: Validate against CI Pool
52-
uses: navikt/sf-platform/.github/actions/ciValidate@79ad1077a810db336f3e39606a25a4a505d5012c
5359
if: ${{ github.event_name == 'pull_request' }}
54-
with:
55-
devhub: "devhub"
56-
pools: ${{ vars.DEFAULT_CI_POOL }}
57-
ref: ${{ github.event.pull_request.head.sha }}
58-
baseRef: ${{ github.event.pull_request.base.sha }}
60+
run: |
61+
command=("sfp" "validate" "pool")
62+
command+=("--pools" "${POOLS}")
63+
command+=("--targetdevhubusername" "${DEVHUB_ALIAS}")
64+
command+=("--mode" "${MODE}")
65+
command+=("--logsgroupsymbol" "::group::,::endgroup::")
66+
command+=("--loglevel" "${SFP_LOG_LEVEL}")
67+
68+
if [ "${COVERAGE_PERCENT}" ]; then
69+
command+=("--coveragepercent" "${COVERAGE_PERCENT}")
70+
fi
71+
72+
if [ "${REF}" ]; then
73+
command+=( "--ref" "${REF}" )
74+
fi
75+
76+
if [ "${BASE_REF}" ]; then
77+
command+=( "--baseRef" "${BASE_REF}" )
78+
fi
79+
80+
if [ "${DELETE_SCRATCH}" == "true" ]; then
81+
command+=("--deletescratchorg")
82+
fi
83+
84+
echo "Executing command: ${command[*]}"
85+
"${command[@]}"
86+
env:
87+
POOLS: ${{ vars.DEFAULT_CI_POOL }}
88+
DEVHUB_ALIAS: "devhub"
89+
COVERAGE_PERCENT: ${{ vars.CODE_COVERAGE_PERCENTAGE }}
90+
MODE: "thorough"
91+
REF: ${{ github.event.pull_request.head.sha }}
92+
BASE_REF: ${{ github.event.pull_request.base.sha }}
93+
DELETE_SCRATCH: "true"
94+
SFP_LOG_LEVEL: ${{ vars.SFP_LOG_LEVEL }}
5995

6096
- name: Delete Stale Validation Org
6197
if: ${{ failure() }}
6298
run: sf org delete scratch -p
63-
64-
- name: Quick build
65-
uses: navikt/sf-platform/.github/actions/ciQuickBuild@f318a266c5a7add9c091f9d3480164fed8abfc08

0 commit comments

Comments
 (0)