@@ -2,6 +2,13 @@ name: Build dependencies and CFEngine hub package
22
33on :
44 workflow_call :
5+ inputs :
6+ additional_artifacts :
7+ description : ' Additional files or directories to include in artifacts'
8+ default : ' '
9+ required : false
10+ type : string
11+
512 secrets :
613 GH_ACTIONS_SSH_DEPLOY_KEY_ENTERPRISE_REPO :
714 required : true
1421
1522jobs :
1623 build_cfengine_hub_package :
17- name : Build package and run selenium tests
24+ name : Build package
1825 runs-on : ubuntu-22.04
1926 steps :
2027 - name : Checkout Together Action
4653 path : masterfiles
4754 ref : ${{steps.together.outputs.masterfiles || github.base_ref}}
4855
49- - name : Checkout Buildscripts (current project)
56+ - name : Checkout Buildscripts
5057 uses : actions/checkout@v3
5158 with :
59+ repository : cfengine/buildscripts
5260 path : buildscripts
5361 fetch-depth : 20
5462
@@ -88,13 +96,13 @@ jobs:
8896 run : echo "DEPS_SHA=$(git log --pretty='format:%h' -1 -- .)" | tee -a ${GITHUB_ENV}
8997 working-directory : buildscripts/deps-packaging
9098
91- - name : restore packages cache
99+ - name : restore artifacts cache
92100 uses : actions/cache/restore@v3
93101 with :
94- path : packages
95- key : packages -${{ env.PACKAGE_SHA }}
102+ path : artifacts
103+ key : artifacts -${{ env.PACKAGE_SHA }}
96104 restore-keys : |
97- packages -${{ env.PACKAGE_SHA }}
105+ artifacts -${{ env.PACKAGE_SHA }}
98106
99107 - name : Restore dependency cache
100108 uses : actions/cache/restore@v3
@@ -106,12 +114,21 @@ jobs:
106114 deps-master
107115 deps
108116
117+ - name : restore configured and built core and nova projects
118+ uses : actions/cache/restore@v3
119+ with :
120+ path : build
121+ key : build-${{ env.PACKAGE_SHA }}
122+ restore-keys : |
123+ build-${{ env.PACKAGE_SHA }}
124+
125+
109126 - name : Build package in docker
110127 env :
111128 GH_ACTIONS_SSH_KEY_BUILD_ARTIFACTS_CACHE : ${{ secrets.GH_ACTIONS_SSH_KEY_BUILD_ARTIFACTS_CACHE }}
112129 run : |
113- if [ ! -f packages /cfe*deb ]; then
114- buildscripts/ci/docker-build-package.sh
130+ if [ ! -f artifacts /cfe*deb ]; then
131+ buildscripts/ci/docker-build-package.sh ${{ inputs.additional_artifacts }}
115132 fi
116133
117134 - name : Save dependency cache
@@ -120,11 +137,13 @@ jobs:
120137 path : cache
121138 key : deps-${{ github.base_ref }}-${{ env.DEPS_SHA }}
122139
123- - name : Save packages cache
140+ - name : Save artifacts cache
124141 uses : actions/cache/save@v3
125142 with :
126- path : packages
127- key : packages-${{ env.PACKAGE_SHA }}
143+ path : |
144+ artifacts
145+ packages
146+ key : artifacts-${{ env.PACKAGE_SHA }}
128147
129148 - name : Save artifacts
130149 if : success() || failure()
0 commit comments