@@ -117,6 +117,70 @@ jobs:
117117 name : Building/fetching current CI target
118118 run : NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "rocq-9.0"
119119 --argstr job "coq-shell"
120+ hierarchy-builder :
121+ needs :
122+ - rocq-core
123+ - rocq-elpi
124+ runs-on : ubuntu-latest
125+ steps :
126+ - name : Determine which commit to initially checkout
127+ run : " if [ ${{ github.event_name }} = \" push\" ]; then\n echo \" target_commit=${{
128+ github.sha }}\" >> $GITHUB_ENV\n else\n echo \" target_commit=${{ github.event.pull_request.head.sha
129+ }}\" >> $GITHUB_ENV\n fi\n "
130+ - name : Git checkout
131+ uses : actions/checkout@v4
132+ with :
133+ fetch-depth : 0
134+ ref : ${{ env.target_commit }}
135+ - name : Determine which commit to test
136+ run : " if [ ${{ github.event_name }} = \" push\" ]; then\n echo \" tested_commit=${{
137+ github.sha }}\" >> $GITHUB_ENV\n else\n merge_commit=$(git ls-remote ${{ github.event.repository.html_url
138+ }} refs/pull/${{ github.event.number }}/merge | cut -f1)\n mergeable=$(git
139+ merge --no-commit --no-ff ${{ github.event.pull_request.base.sha }} > /dev/null
140+ 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n if [ -z \" $merge_commit\" \
141+ \ -o \" x$mergeable\" != \" x0\" ]; then\n echo \" tested_commit=${{ github.event.pull_request.head.sha
142+ }}\" >> $GITHUB_ENV\n else\n echo \" tested_commit=$merge_commit\" >> $GITHUB_ENV\n \
143+ \ fi\n fi\n "
144+ - name : Git checkout
145+ uses : actions/checkout@v4
146+ with :
147+ fetch-depth : 0
148+ ref : ${{ env.tested_commit }}
149+ - name : Cachix install
150+ uses : cachix/install-nix-action@v31
151+ with :
152+ nix_path : nixpkgs=channel:nixpkgs-unstable
153+ - name : Cachix setup coq-community
154+ uses : cachix/cachix-action@v16
155+ with :
156+ authToken : ${{ secrets.CACHIX_AUTH_TOKEN }}
157+ extraPullNames : coq, math-comp
158+ name : coq-community
159+ - id : stepGetDerivation
160+ name : Getting derivation for current job (hierarchy-builder)
161+ run : " NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr bundle
162+ \" rocq-9.0\" --argstr job \" hierarchy-builder\" \\\n --dry-run 2> err >
163+ out || (touch fail; true)\n cat out err\n if [ -e fail ]; then echo \" Error:
164+ getting derivation failed\" ; exit 1; fi\n "
165+ - id : stepCheck
166+ name : Checking presence of CI target for current job
167+ run : " if $(cat out err | grep -q \" built:\" ) ; then\n echo \" CI target needs
168+ actual building\"\n if $(cat out err | grep -q \" derivations will be built:\" \
169+ ) ; then\n echo \" waiting a bit for derivations that should be in cache\" \
170+ \n sleep 30\n fi\n else\n echo \" CI target already built\"\n echo \" \
171+ status=fetched\" >> $GITHUB_OUTPUT\n fi\n "
172+ - if : steps.stepCheck.outputs.status != 'fetched'
173+ name : ' Building/fetching previous CI target: rocq-core'
174+ run : NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "rocq-9.0"
175+ --argstr job "rocq-core"
176+ - if : steps.stepCheck.outputs.status != 'fetched'
177+ name : ' Building/fetching previous CI target: rocq-elpi'
178+ run : NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "rocq-9.0"
179+ --argstr job "rocq-elpi"
180+ - if : steps.stepCheck.outputs.status != 'fetched'
181+ name : Building/fetching current CI target
182+ run : NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "rocq-9.0"
183+ --argstr job "hierarchy-builder"
120184 rocq-core :
121185 needs : []
122186 runs-on : ubuntu-latest
0 commit comments