70
70
# # anyway please read .github/README.md
71
71
check_workflow_yaml_coressponds_to_src_yaml :
72
72
runs-on : ubuntu-20.04 # ubuntu-latest
73
- # container: ubuntu:latest ## This is required as barrier between AWS-hosted runners and GitHub-hosted runners - they have different set of software, so run in container
74
73
name : Check if github workflows were properly made from sources
75
74
steps :
76
75
- &step_detect_commented_pr
@@ -232,14 +231,6 @@ jobs:
232
231
matrix_dockerimage_release : ${{steps.matrixes.outputs.matrix_dockerimage_release}}
233
232
matrix_dockerimage_debug : ${{steps.matrixes.outputs.matrix_dockerimage_debug}}
234
233
235
- buildspec_ubuntu : ${{steps.matrixes.outputs.buildspec_ubuntu}}
236
- buildspec_ubuntu_debug : ${{steps.matrixes.outputs.buildspec_ubuntu_release}}
237
- buildspec_ubuntu_release : ${{steps.matrixes.outputs.buildspec_ubuntu_debug}}
238
- buildspec_macos : ${{steps.matrixes.outputs.buildspec_macos}}
239
- buildspec_windows : ${{steps.matrixes.outputs.buildspec_windows}}
240
- buildspec_dockerimage_release : ${{steps.matrixes.outputs.buildspec_dockerimage_release}}
241
- buildspec_dockerimage_debug : ${{steps.matrixes.outputs.buildspec_dockerimage_debug}}
242
-
243
234
# # Build docker image named 'hyperledger/iroha-builder' with all stuff to compile iroha and its dependancies
244
235
# # The result docker image is pushed with tags :pr-NUMBER, :commit-HASH, :branch-name, :tag-name,
245
236
# # and conditional tags :edge for development branch, and :latest for git-tags.
@@ -318,18 +309,11 @@ jobs:
318
309
type=ref,event=pr
319
310
type=ref,event=tag
320
311
type=schedule
321
- type=edge,branch=develop
322
- # type=semver,pattern={{version}}
323
- # type=semver,pattern={{major}}.{{minor}}
324
- # type=sha,prefix=commit-,format=short
325
- # type=sha,prefix=commit-,format=long
326
312
# # Docker image will be pushed with tags:
327
313
# # - hash of file Dockerfile.builder
328
314
# # - branchname, when branch is pushed
329
315
# # - pr-NUMBER, when pushed to PR
330
316
# # - git tag when tag is pushed
331
- # # - semver like 1.2.3 and 1.2 when tag vX.X.X is pushed
332
- # # - tag 'edge' when branch support/1.2.x is pushed
333
317
# # - schedule, see the docs
334
318
- &step_docker_meta_ghcr
335
319
<< : *step_docker_meta
@@ -380,29 +364,16 @@ jobs:
380
364
name : Check if dockertaghash exists in remote registry
381
365
id : dockertag_already
382
366
run : |
383
- ## FIXME page size is 100 and cannot be more, this needs to be extended in loop asking tags till the end
384
- exists=$( curl -fL https://hub.docker.com/v2/repositories/$DOCKERHUB_ORG/iroha-builder/tags |
385
- jq 'any( .results[]|.name == "${{env.dockertag}}" ; .)' )
386
- echo "::set-output name=exists::$exists"
387
-
388
- if test $exists = true ;then
389
- tag=$dockertag
390
- else
391
- tag=edge
392
- fi
393
- container="$DOCKERHUB_ORG/iroha-builder:$tag"
394
- echo "::set-output name=container::$container"
395
- echo "::set-output name=container_tag::$tag"
367
+ echo "::set-output name=container::$DOCKERHUB_ORG/iroha-builder:$dockertag"
396
368
-
397
- if : ${{ steps.dockertag_already.outputs.container_tag != env.dockertag ||
398
- steps.dockertag_already.outputs.container == '' }}
399
- name : Possible ERROR, edited but not pushed
369
+ name : Possible ERROR, Dockerfile edited but image cannot be pushed
370
+ if : ${{ steps.docker_login.outcome != 'success' || steps.build_and_push.outcome != 'success' }}
400
371
env :
401
372
container : ${{steps.dockertag_already.outputs.container}}
402
373
dockertag : ${{env.dockertag}}
403
374
run : |
404
375
cat <<END
405
- ::error::Running on container '$container', YOUR CHANGES TO Dockerfile.builder WERE NOT APPLYED.
376
+ ::error::CHANGES TO Dockerfile.builder WERE NOT APPLYED.
406
377
407
378
It seems container with tag '$dockertag' was not pushed to registry and does not exist remotely.
408
379
The most possible reason is GitHub secrets are inaccessable to PRs from public forks.
@@ -425,12 +396,9 @@ jobs:
425
396
# # WARN secret dropped from output!, output may not contain secret,
426
397
# # and secret cannot be used in job:container directly, and there is no github non-secret variables...
427
398
# # if dockertag is already pushed then use it. But let it be empty when tag does not exist remotely.
428
- dockertag : ${{steps.dockertag.outputs.dockertag}}
429
- _dockertag : : ${{steps.dockertag .outputs.dockertag }}
399
+ dockertag : ${{steps.dockertag.outputs.dockertag}}
400
+ container : ${{steps.dockertag_already .outputs.container }}
430
401
pushed : ${{ steps.docker_login.outcome == 'success' && steps.build_and_push.outcome == 'success' }}
431
- dockertag_already_exists : ${{steps.dockertag_already.outputs.exists}}
432
- container : ${{steps.dockertag_already.outputs.container}}
433
- container_tag : ${{steps.dockertag_already.outputs.container_tag}}
434
402
435
403
# # Build iroha in a container made of the image earlier prepared
436
404
# # Result artifacts are
@@ -440,9 +408,8 @@ jobs:
440
408
needs :
441
409
- Docker-iroha-builder
442
410
- generate_matrixes
443
- runs-on : [ self-hosted, Linux ] # ubuntu-latest
444
- # # Container is taken from previous job
445
- container : # &container
411
+ runs-on : [ self-hosted, Linux ]
412
+ container : # # Container is taken from previous job
446
413
image : &container_image ${{needs.Docker-iroha-builder.outputs.container}}
447
414
options : --user root
448
415
strategy : &strategy_ubuntu_debug
@@ -461,36 +428,9 @@ jobs:
461
428
${{ toJson(needs) }}
462
429
END
463
430
-
464
- run : test -n "$container"
465
- env :
466
- container : *container_image
467
- -
468
- if : ${{ needs.Docker-iroha-builder.outputs.container_tag != needs.Docker-iroha-builder.outputs.dockertag ||
469
- needs.Docker-iroha-builder.outputs.container == '' }}
470
- name : Possible WARNING
471
431
env :
472
432
container : *container_image
473
- dockertag : ${{needs.Docker-iroha-builder.outputs.dockertag}}
474
- run : |
475
- cat <<END
476
- ::warning::Running on container '$container', YOUR CHANGES TO Dockerfile.builder WERE NOT APPLYED.
477
-
478
- It seems container with tag '$dockertag' was not pushed to registry and does not exist remotely.
479
- The most possible reason is GitHub secrets are inaccessable to PRs from public forks.
480
-
481
- $(test ${{github.event.pull_request.head.repo.full_name}} != ${{github.event.pull_request.base.repo.full_name}} \
482
- && echo -n "SECRETS ARE NOT EXPOSED TO FORKS" || echo -n "SECRETS AVAILABLE")
483
-
484
- **Consider to open PR from the same organization.**
485
-
486
- What we know about this build:
487
- - PR URL is ${{github.event.pull_request.html_url}}
488
- - head repo is '${{github.event.pull_request.head.repo.full_name}}'
489
- - base repo is '${{github.event.pull_request.base.repo.full_name}}'
490
- - See more information in previous step 'Show context'
491
-
492
- Please ask @kuvaldini on GitHub or in Telegram if you need help.
493
- END
433
+ run : test -n "$container"
494
434
- *step_system_info
495
435
- *step_build_info
496
436
- &step_env_from_buildspec
@@ -541,7 +481,6 @@ jobs:
541
481
- &step_store_ccache_stats
542
482
run : ccache --show-stats | tee /tmp/ccache-stats
543
483
- &step_vcpkg_cache
544
- # if: ${{false}} ## This works bad when something patched or something updated, seems they does not recalc hash of changed packages. See todos in the begining of file.
545
484
# # Read the docs https://vcpkg.readthedocs.io/en/latest/users/binarycaching/ https://github.com/microsoft/vcpkg/blob/master/docs/users/binarycaching.md
546
485
name : Restore cache Vcpkg binarycache # # NOTE not useng NuGet because on ubuntu nuget needs mono of 433MB, unusable.
547
486
uses : actions/cache@v2
@@ -810,7 +749,6 @@ jobs:
810
749
- &step_brew_postgres
811
750
name : Install Postgres on MacOS
812
751
run : brew install postgresql
813
- # # ToDo may be optimize, i.e. cache package
814
752
- << : *step_ctest
815
753
timeout-minutes : 70
816
754
@@ -832,10 +770,7 @@ jobs:
832
770
strategy :
833
771
fail-fast : false
834
772
matrix : ${{ fromJSON( needs.generate_matrixes.outputs.matrix_windows ) }}
835
- # if: ${{ false }} ##FIXME Somehow cmake fails to find GTest and others
836
773
if : ${{ false && ( fromJSON( needs.generate_matrixes.outputs.matrix_windows ).include[0] ) }}
837
- # matrix:
838
- # BuildYype: [ Debug ] #,Release, RelWithDebInfo
839
774
defaults :
840
775
run :
841
776
shell : bash # pwsh
@@ -872,17 +807,16 @@ jobs:
872
807
- *step_cmake_configure
873
808
- *step_cmake_build
874
809
- *step_always_after_build
875
- -
876
- name : Install Postgres on Windows
810
+ - name : Install Postgres on Windows
877
811
run : choco install postgresql
878
812
# - *step_ctest
879
813
880
814
# # Build and publish docker image named 'hyperledger/iroha' with irohad and iroha tools inside.
881
- # # The result docker image is pushed with tags :pr-NUMBER , :commit-HASH , :branch-name, :tag-name ,
882
- # # and conditional tags :edge (for development branches) and : latest (for git-tags)
815
+ # # The result docker image is pushed with tags :branch_name , :pr-NUMBER , :tag_name ,
816
+ # # and : latest (for git-tags).
883
817
# # Those docker image tags could be extended with suffixes with compiler and build type like
884
- # # -gcc10, -clang, -debug, -gcc10-debug.
885
- # # Result image name could look like: hyperledger/iroha:pr-1117, hyperledger/iroha-burrow:commit-XXXXX-debug
818
+ # # -gcc10, -clang, -debug, -gcc10-debug. Like :latest-debug, :main-debug, :1.3.0-gcc10-debug.
819
+ # # Result image name could look like: hyperledger/iroha:pr-1117, hyperledger/iroha:nightly.
886
820
# # Note: image is push only when DockerHub login-token pair available - not to PRs from forks
887
821
docker-R : &job_docker_image_release
888
822
needs :
@@ -906,26 +840,28 @@ jobs:
906
840
- *step_detect_commented_pr
907
841
- *step_checkout
908
842
- *step_artifact_suffix
909
- - &step_download_artifact_iroha_deb
910
- name : Download artifact
843
+ - name : Download artifact
911
844
uses : actions/download-artifact@v2
912
845
with :
913
846
name : iroha-deb${{env.ARTIFACT_SUFFIX}}
914
- - &rename_artifact_deb
915
- name : Rename artifact debs
847
+ - name : Rename artifact debs
916
848
run : |
917
849
mv *iroha_shepherd.deb docker/release/iroha_shepherd.deb
918
850
mv *irohad.deb docker/release/iroha.deb
919
- - &step_dockertag_release
920
- << : *step_docker_tag
851
+ - << : *step_docker_tag
921
852
env :
922
853
dockertag : ${{ hashFiles('docker/release/**') }}
923
854
- << : *step_docker_meta
924
855
with : &step_docker_release_meta_with
925
- << : *step_docker_meta_with
926
856
images : |
927
857
${{ env.DOCKERHUB_ORG }}/${{ env.IMAGE_NAME }}${{ env._uses_suffix }}
928
- flavor : suffix=${{env._compiler_suffix}}${{env._debug_suffix}}
858
+ tags : |
859
+ type=ref,event=branch
860
+ type=ref,event=pr
861
+ type=ref,event=tag
862
+ type=schedule
863
+ flavor : |
864
+ suffix=${{env._compiler_suffix}}${{env._debug_suffix}},onlatest=true
929
865
# maybetodo flavor: prefix=${{ env.USES_PREFIX }} ## In case creating repository hyperledger/iroha-burrow denied, Use tag prefix hyperledger/iroha:burrow-xxxx
930
866
- << : *step_docker_meta_ghcr
931
867
with :
0 commit comments