Skip to content

Commit aaef619

Browse files
authored
Merge branch 'main' into testbranch
2 parents 1a22f3e + 793d52d commit aaef619

File tree

6 files changed

+137
-138
lines changed

6 files changed

+137
-138
lines changed

.github/actions/ciQuickBuild/action.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

.github/actions/ciValidate/action.yml

Lines changed: 0 additions & 65 deletions
This file was deleted.

.github/workflows/autoLaunched.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

.github/workflows/buildAndPublish.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,22 @@ on:
44
secrets:
55
SF_DEVHUB_URL:
66
required: true
7+
push:
8+
branches:
9+
- main
710
workflow_dispatch:
811
concurrency:
912
group: ${{ github.workflow }}-${{ github.ref_name }}
1013
jobs:
14+
staticCodeValidation:
15+
name: Validation jobs
16+
uses: navikt/sf-platform/.github/workflows/ciStaticCodeValidation.yml@main
17+
permissions:
18+
contents: read
19+
1120
checkChanges:
1221
name: Check changes
22+
needs: staticCodeValidation
1323
runs-on: ubuntu-latest
1424
outputs:
1525
hasSrcChanges: ${{ steps.checkChanges.outputs.hasSrcChanges }}
Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
1-
name: "Validate package changes"
1+
name: "[PUSH] Quickbuild"
22
on:
3-
workflow_call:
4-
secrets:
5-
SF_DEVHUB_URL:
6-
required: true
7-
workflow_dispatch:
3+
push:
4+
branches-ignore:
5+
- main
86
concurrency:
9-
group: ${{ github.workflow }}-${{ github.ref_name }}
7+
group: ci-${{ github.ref_name }}
108
jobs:
9+
staticCodeValidation:
10+
name: Validation jobs
11+
uses: navikt/sf-platform/.github/workflows/ciStaticCodeValidation.yml@main
12+
permissions:
13+
contents: read
14+
1115
checkChanges:
1216
name: Check changes
17+
needs: staticCodeValidation
1318
runs-on: ubuntu-latest
1419
outputs:
1520
hasSrcChanges: ${{ steps.checkChanges.outputs.hasSrcChanges }}
@@ -21,12 +26,11 @@ jobs:
2126
with:
2227
fetch-depth: 0
2328
persist-credentials: false
24-
2529
- uses: navikt/sf-platform/.github/actions/checkForPackageChanges@8a76cf6726f88608113bd6cc313b4a6728ce476a
2630
id: checkChanges
2731

28-
validateChanges:
29-
name: Validate changes
32+
quickBuild:
33+
name: Quickbuild
3034
needs: checkChanges
3135
if: ${{ github.event_name == 'workflow_dispatch' || needs.checkChanges.outputs.hasSrcChanges == 'true' }}
3236
runs-on: ubuntu-latest
@@ -48,18 +52,19 @@ jobs:
4852
alias: "devhub"
4953
setDefaultDevhubUsername: "true"
5054

51-
- name: Validate against CI Pool
52-
uses: navikt/sf-platform/.github/actions/ciValidate@79ad1077a810db336f3e39606a25a4a505d5012c
53-
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 }}
59-
60-
- name: Delete Stale Validation Org
61-
if: ${{ failure() }}
62-
run: sf org delete scratch -p
55+
- name: "Quickbuild package"
56+
id: quickbuildPackage
57+
shell: bash
58+
run: |
59+
sfp quickbuild --devhubalias devhub --diffcheck --buildnumber ${GITHUB_RUN_ID} --branch ${GITHUB_REF#refs/heads/} --loglevel ${SFP_LOG_LEVEL}
60+
env:
61+
SFP_LOG_LEVEL: ${{ vars.SFP_LOG_LEVEL }}
6362

64-
- name: Quick build
65-
uses: navikt/sf-platform/.github/actions/ciQuickBuild@f318a266c5a7add9c091f9d3480164fed8abfc08
63+
- name: Upload artifacts and logs
64+
if: always()
65+
uses: navikt/sf-platform/.github/actions/uploadWorkflowArtifactsAndLogs@f318a266c5a7add9c091f9d3480164fed8abfc08
66+
with:
67+
artifactName: "build-artifacts"
68+
uploadArtifacts: true
69+
logName: "build-logs"
70+
publishLogs: true
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: "[PR] Validate package changes"
2+
on:
3+
pull_request:
4+
workflow_call:
5+
secrets:
6+
SF_DEVHUB_URL:
7+
required: true
8+
workflow_dispatch:
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref_name }}
11+
jobs:
12+
staticCodeValidation:
13+
name: Validation jobs
14+
uses: navikt/sf-platform/.github/workflows/ciStaticCodeValidation.yml@main
15+
permissions:
16+
contents: read
17+
18+
checkChanges:
19+
name: Check changes
20+
needs: staticCodeValidation
21+
runs-on: ubuntu-latest
22+
outputs:
23+
hasSrcChanges: ${{ steps.checkChanges.outputs.hasSrcChanges }}
24+
permissions:
25+
contents: read
26+
steps:
27+
- name: "Checkout"
28+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
29+
with:
30+
fetch-depth: 0
31+
persist-credentials: false
32+
33+
- uses: navikt/sf-platform/.github/actions/checkForPackageChanges@8a76cf6726f88608113bd6cc313b4a6728ce476a
34+
id: checkChanges
35+
36+
validateChanges:
37+
name: Validate changes
38+
needs: checkChanges
39+
if: ${{ github.event_name == 'workflow_dispatch' || needs.checkChanges.outputs.hasSrcChanges == 'true' }}
40+
runs-on: ubuntu-latest
41+
container: ghcr.io/flxbl-io/sfp:${{ vars.SFP_CONTAINER_VERSION }}
42+
permissions:
43+
contents: read
44+
steps:
45+
- name: "Checkout"
46+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
47+
with:
48+
fetch-depth: 0
49+
persist-credentials: true
50+
51+
- name: Authenticate DevHub
52+
uses: navikt/sf-platform/.github/actions/authenticateOrg@a0f22eb5d1c9d1ec5e345c04c96a786bd150042a
53+
with:
54+
auth-url: ${{ secrets.SF_DEVHUB_URL }}
55+
alias: "devhub"
56+
setDefaultDevhubUsername: "true"
57+
58+
- name: Validate against CI Pool
59+
if: ${{ github.event_name == 'pull_request' }}
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 }}
95+
96+
- name: Delete Stale Validation Org
97+
if: ${{ failure() }}
98+
run: sf org delete scratch -p

0 commit comments

Comments
 (0)