Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Iroha select label and restore temporary changes #2903

Merged
merged 4 commits into from
Oct 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 43 additions & 33 deletions .github/build-iroha1-fork.src.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@ jobs:
env:
JSON_github: ${{ toJSON(github) }}
JSON_needs: ${{ toJson(needs) }}

- &step_checkout_head
name: Checkout head
uses: actions/checkout@v2
with: &step_checkout_with_head
ref: ${{ github.event.pull_request.head.sha }}
ref: ${{ github.event.pull_request.head.sha }}

- name: Filter files
uses: dorny/paths-filter@v2
id: filter
Expand All @@ -56,11 +58,19 @@ jobs:
- "docker/release/wait-for-it.sh"
build_dependecies:
- "vcpkg/build_iroha_deps.sh"

- name: verify .github folder is not changed
if: steps.filter.outputs.github == 'true'
run: |
echo "Pull requests from forks are not allowed to change .github folder"
false

- name: verify Dockerfiles and scripts in docker directory are not changed
if: steps.filter.outputs.dockerfile == 'true'
run: |
echo "Pull requests from forks are not allowed to change Dockerfiles"
false

- name: verify build depedencies script is not changed
if: steps.filter.outputs.build_dependecies == 'true'
run: |
Expand Down Expand Up @@ -108,12 +118,12 @@ jobs:
commit_was_merged_build_spec(){
git_is_merge_commit $1 &&
git log -n1 $1 --format=%s | grep -q '^Merge branch' &&
echo "/build before-merge"
echo "/build ubuntu debug release normal gcc-10"
}
case ${{github.event_name}} in
pull_request_target) if commit_message_body_build_spec FETCH_HEAD >/tmp/comment_body ;then
if git_is_merge_commit FETCH_HEAD ;then
echo ::warning::'/build directive in merge commit overrides default "/build before-merge"'
echo ::warning::'/build directive in merge commit overrides default "/build ubuntu debug release normal gcc-10"'
fi
elif commit_was_merged_build_spec FETCH_HEAD >/tmp/comment_body ;then
true
Expand Down Expand Up @@ -165,7 +175,7 @@ jobs:
matrix_dockerimage_release: ${{steps.matrixes.outputs.matrix_dockerimage_release}}
matrix_dockerimage_debug: ${{steps.matrixes.outputs.matrix_dockerimage_debug}}

## Build docker image named 'hyperledger/iroha-builder' with all stuff to compile iroha and its dependancies
## Build docker image named 'hyperledger/iroha-builder' with all stuff to compile iroha and its dependencies
## The result docker image is pushed with tags :pr-NUMBER, :commit-HASH, :branch-name, :tag-name,
## and conditional tags :edge for development branch, and :latest for git-tags.
Docker-iroha-builder:
Expand Down Expand Up @@ -261,13 +271,13 @@ jobs:
- &step_docker_buildx
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
# - &step_docker_cache
# name: Cache Docker layers
# uses: actions/cache@v2
# with:
# path: /tmp/.buildx-cache
# key: ${{ runner.os }}-buildx-${{env.dockertag}}
# restore-keys: ${{ runner.os }}-buildx-
- &step_docker_cache
name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{env.dockertag}}
restore-keys: ${{ runner.os }}-buildx-
- &step_docker_build_and_push
id: build_and_push
name: Build and push
Expand Down Expand Up @@ -319,7 +329,7 @@ jobs:
needs:
- Docker-iroha-builder
- generate_matrixes
runs-on: [ self-hosted, Linux ]
runs-on: [ self-hosted, Linux, iroha ]
permissions: read-all
container: ## Container is taken from previous job
image: &container_image ${{needs.Docker-iroha-builder.outputs.container}}
Expand Down Expand Up @@ -384,26 +394,26 @@ jobs:
echo >>$GITHUB_ENV _CCACHE_DIR=$($(realpath $CCACHE_PATH/gcc) --show-config | sed -nE 's,.*cache_dir = ,,p')
echo >>$GITHUB_ENV NPROC=$(nproc | awk '{printf("%.0f",$1*0.77)}')
echo >>$GITHUB_ENV HOME=$HOME
# - &step_restore_ccache
# name: Restore cache CCache
# uses: actions/cache@v2
# with:
# path: ${{ env._CCACHE_DIR }}
# key: ${{runner.os}}-ccache-${{ github.event.pull_request.head.sha }}
# restore-keys: ${{runner.os}}-ccache-
# - &step_store_ccache_stats
# run: ccache --show-stats | tee /tmp/ccache-stats
# - &step_vcpkg_cache
# ## Read the docs https://vcpkg.readthedocs.io/en/latest/users/binarycaching/ https://github.com/microsoft/vcpkg/blob/master/docs/users/binarycaching.md
# name: Restore cache Vcpkg binarycache ## NOTE not useng NuGet because on ubuntu nuget needs mono of 433MB, unusable.
# uses: actions/cache@v2
# with:
# path: |
# ${{env.HOME}}/.cache/vcpkg/archives
# key: ${{runner.os}}-vcpkg-${{env.CC_NAME}}.${{ hashFiles('vcpkg/**') }}
# restore-keys: ${{runner.os}}-vcpkg-${{env.CC_NAME}}.
- &step_restore_ccache
name: Restore cache CCache
uses: actions/cache@v2
with:
path: ${{ env._CCACHE_DIR }}
key: ${{runner.os}}-ccache-${{ github.event.pull_request.head.sha }}
restore-keys: ${{runner.os}}-ccache-
- &step_store_ccache_stats
run: ccache --show-stats | tee /tmp/ccache-stats
- &step_vcpkg_cache
## Read the docs https://vcpkg.readthedocs.io/en/latest/users/binarycaching/ https://github.com/microsoft/vcpkg/blob/master/docs/users/binarycaching.md
name: Restore cache Vcpkg binarycache ## NOTE not useng NuGet because on ubuntu nuget needs mono of 433MB, unusable.
uses: actions/cache@v2
with:
path: |
${{env.HOME}}/.cache/vcpkg/archives
key: ${{runner.os}}-vcpkg-${{env.CC_NAME}}.${{ hashFiles('vcpkg/**') }}
restore-keys: ${{runner.os}}-vcpkg-${{env.CC_NAME}}.
- &step_vcpkg_build
name: Build iroha vcpkg dependancies
name: Build iroha vcpkg dependencies
run: ./vcpkg/build_iroha_deps.sh $PWD/vcpkg-build; test -f $PWD/vcpkg-build/scripts/buildsystems/vcpkg.cmake
## Takes 48m16s on default GitHub runner with 2 cores
## Takes 13m41s on self-hosted AWS EC2 c5.x4large
Expand Down Expand Up @@ -741,7 +751,7 @@ jobs:
needs:
- build-UR
- generate_matrixes
runs-on: [ self-hosted, Linux ] #ubuntu-latest
runs-on: [ self-hosted, Linux, iroha ] #ubuntu-latest
# strategy: *strategy_ubuntu_release
# if: *if_ubuntu_release
strategy:
Expand Down Expand Up @@ -813,4 +823,4 @@ jobs:
strategy:
fail-fast: false
matrix: ${{ fromJSON( needs.generate_matrixes.outputs.matrix_dockerimage_debug ) }}
if: ${{ fromJSON( needs.generate_matrixes.outputs.matrix_dockerimage_debug ).include[0] }}
if: ${{ fromJSON( needs.generate_matrixes.outputs.matrix_dockerimage_debug ).include[0] }}
4 changes: 2 additions & 2 deletions .github/build-iroha1.src.yml
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ jobs:
needs:
- Docker-iroha-builder
- generate_matrixes
runs-on: [ self-hosted, Linux ]
runs-on: [ self-hosted, Linux, iroha ]
container: ## Container is taken from previous job
image: &container_image ${{needs.Docker-iroha-builder.outputs.container}}
options: --user root
Expand Down Expand Up @@ -824,7 +824,7 @@ jobs:
needs:
- build-UR
- generate_matrixes
runs-on: [ self-hosted, Linux ] #ubuntu-latest
runs-on: [ self-hosted, Linux, iroha ] #ubuntu-latest
# strategy: *strategy_ubuntu_release
# if: *if_ubuntu_release
strategy:
Expand Down
Loading