diff --git a/.github/workflows/analyzers.yml b/.github/workflows/analyzers.yml index 90cc1953..8531a160 100644 --- a/.github/workflows/analyzers.yml +++ b/.github/workflows/analyzers.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-20.04 if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository steps: - - uses: actions/checkout@50fbc622fc4ef5163becd7fab6573eac35f8462e + - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 #v3.1.0 - name: Installing clang-format 12 env: DEBIAN_FRONTEND: noninteractive @@ -19,8 +19,8 @@ jobs: runs-on: ubuntu-20.04 if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository steps: - - uses: actions/checkout@50fbc622fc4ef5163becd7fab6573eac35f8462e - - uses: actions/setup-python@41b7212b1668f5de9d65e9c82aa777e6bbedb3a8 + - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 #v3.1.0 + - uses: actions/setup-python@13ae5bb136fac2878aff31522b9efb785519f984 #v4.3.0 with: python-version: '3.x' architecture: 'x64' @@ -35,6 +35,6 @@ jobs: runs-on: ubuntu-20.04 if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository steps: - - uses: actions/checkout@50fbc622fc4ef5163becd7fab6573eac35f8462e + - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 #v3.1.0 - name: Run code-inspector run: ci/code-inspector-check.sh diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 3b375d07..2623c826 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -25,7 +25,7 @@ jobs: continue-on-error: true timeout-minutes: 60 steps: - - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f + - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 #v3.1.0 with: submodules: "recursive" - name: Fetch Deps diff --git a/.github/workflows/develop.yml b/.github/workflows/develop_branch_dockers_deploy.yml similarity index 83% rename from .github/workflows/develop.yml rename to .github/workflows/develop_branch_dockers_deploy.yml index 9556e30f..008b396a 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop_branch_dockers_deploy.yml @@ -1,4 +1,4 @@ -name: Develop +name: Develop Branch Dockers Deploy on: push: @@ -9,7 +9,7 @@ jobs: linux_job: runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f + - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 #v3.1.0 with: submodules: "recursive" - name: Fetch Deps diff --git a/.github/workflows/test_network_artifacts.yml b/.github/workflows/test_network_artifacts.yml index cf75363d..4462759a 100644 --- a/.github/workflows/test_network_artifacts.yml +++ b/.github/workflows/test_network_artifacts.yml @@ -24,7 +24,7 @@ jobs: - name: tag run: | echo "TAG=${{ github.event.inputs.ref }}" >> $GITHUB_ENV - - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f + - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 #v3.1.0 with: submodules: "recursive" ref: ${{ github.event.inputs.ref }} @@ -48,7 +48,7 @@ jobs: - name: tag run: | echo "TAG=${{ github.event.inputs.ref }}" >> $GITHUB_ENV - - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f + - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 #v3.1.0 with: submodules: "recursive" ref: ${{ github.event.inputs.ref }} @@ -74,7 +74,7 @@ jobs: - name: tag run: | echo "TAG=${{ github.event.inputs.ref }}" >> $GITHUB_ENV - - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f + - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 #v3.1.0 with: submodules: "recursive" ref: ${{ github.event.inputs.ref }} @@ -106,7 +106,7 @@ jobs: - name: tag run: | Write-Output "TAG=${{ github.event.inputs.ref }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f + - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 #v3.1.0 with: submodules: "recursive" ref: ${{ github.event.inputs.ref }} diff --git a/.github/workflows/tests.yml b/.github/workflows/unit_tests.yml similarity index 93% rename from .github/workflows/tests.yml rename to .github/workflows/unit_tests.yml index 76eae2be..fba25ffd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/unit_tests.yml @@ -1,4 +1,4 @@ -name: Tests +name: Unit Tests on: [push, pull_request] @@ -22,7 +22,7 @@ jobs: runs-on: macOS-11 if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository steps: - - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f + - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 #v3.1.0 with: submodules: "recursive" - name: Fetch Deps @@ -55,7 +55,7 @@ jobs: RELEASE: ${{ matrix.RELEASE }} if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository steps: - - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f + - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 #v3.1.0 with: submodules: "recursive" - name: Fetch Deps @@ -87,7 +87,7 @@ jobs: RELEASE: ${{ matrix.RELEASE }} if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository steps: - - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f + - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 #v3.1.0 with: submodules: "recursive" - name: Windows Defender diff --git a/ci/actions/linux/docker-impl/docker-common.sh b/ci/actions/linux/docker-impl/docker-common.sh index 96475088..c61e1448 100755 --- a/ci/actions/linux/docker-impl/docker-common.sh +++ b/ci/actions/linux/docker-impl/docker-common.sh @@ -26,7 +26,7 @@ elif [[ "$GITHUB_WORKFLOW" = "Test" ]]; then network="test" fi -if [[ "$GITHUB_WORKFLOW" != "Develop" ]]; then +if [[ "$GITHUB_WORKFLOW" != "Develop Branch Dockers Deploy" ]]; then docker_image_name="nanocurrency/nano${network_tag_suffix}" fi @@ -37,7 +37,7 @@ docker_build() ci_version_pre_release="$CI_VERSION_PRE_RELEASE" fi - if [[ "$GITHUB_WORKFLOW" != "Develop" ]]; then + if [[ "$GITHUB_WORKFLOW" != "Develop Branch Dockers Deploy" ]]; then ghcr_image_name="ghcr.io/${GITHUB_REPOSITORY}/nano${network_tag_suffix}" "$scripts"/build-docker-image.sh docker/node/Dockerfile "$docker_image_name" --build-arg NETWORK="$network" --build-arg CI_BUILD=true --build-arg CI_VERSION_PRE_RELEASE="$ci_version_pre_release" --build-arg CI_TAG="$CI_TAG" for tag in "${tags[@]}"; do @@ -56,7 +56,7 @@ docker_deploy() { if [ -n "$DOCKER_PASSWORD" ]; then echo "$DOCKER_PASSWORD" | docker login -u nanoreleaseteam --password-stdin - if [[ "$GITHUB_WORKFLOW" = "Develop" ]]; then + if [[ "$GITHUB_WORKFLOW" = "Develop Branch Dockers Deploy" ]]; then "$scripts"/custom-timeout.sh 30 docker push "nanocurrency/nano-env:base" "$scripts"/custom-timeout.sh 30 docker push "nanocurrency/nano-env:gcc" "$scripts"/custom-timeout.sh 30 docker push "nanocurrency/nano-env:clang" diff --git a/ci/actions/linux/ghcr_push.sh b/ci/actions/linux/ghcr_push.sh index 46af0760..7257ec04 100755 --- a/ci/actions/linux/ghcr_push.sh +++ b/ci/actions/linux/ghcr_push.sh @@ -2,10 +2,11 @@ set -e scripts="$PWD/ci" -if [[ "$GITHUB_WORKFLOW" = "Develop" ]]; then +if [[ "$GITHUB_WORKFLOW" = "Develop Branch Dockers Deploy" ]]; then "$scripts"/custom-timeout.sh 30 docker push "ghcr.io/${GITHUB_REPOSITORY}/nano-env:base" "$scripts"/custom-timeout.sh 30 docker push "ghcr.io/${GITHUB_REPOSITORY}/nano-env:gcc" "$scripts"/custom-timeout.sh 30 docker push "ghcr.io/${GITHUB_REPOSITORY}/nano-env:clang" + "$scripts"/custom-timeout.sh 30 docker push "ghcr.io/${GITHUB_REPOSITORY}/nano-env:centos" else tags=$(docker images --format '{{.Repository}}:{{.Tag }}' | grep "ghcr.io" | grep -vE "env|none") for a in $tags; do diff --git a/ci/actions/linux/install_deps.sh b/ci/actions/linux/install_deps.sh index a78a5b4f..1478dbb7 100755 --- a/ci/actions/linux/install_deps.sh +++ b/ci/actions/linux/install_deps.sh @@ -1,5 +1,9 @@ #!/bin/bash +set -x + +echo "Script ci/actions/linux/install_deps.sh starting COMPILER=\"$COMPILER\"" + # This enables IPv6 support in docker, needed to run node tests inside docker container sudo mkdir -p /etc/docker && echo '{"ipv6":true,"fixed-cidr-v6":"2001:db8:1::/64"}' | sudo tee /etc/docker/daemon.json && sudo service docker restart @@ -11,3 +15,5 @@ else ci/build-docker-image.sh docker/ci/Dockerfile-clang nanocurrency/nano-env:clang ci/build-docker-image.sh docker/ci/Dockerfile-centos nanocurrency/nano-env:centos fi + +echo "Script ci/actions/linux/install_deps.sh finished" diff --git a/ci/build-docker-image.sh b/ci/build-docker-image.sh index 8a8a08e5..88d49168 100755 --- a/ci/build-docker-image.sh +++ b/ci/build-docker-image.sh @@ -1,5 +1,5 @@ #!/bin/bash -set -u +set -u -x if [ "$#" -lt 2 ]; then echo 'Usage: build-docker-image.sh [...]' >&2 @@ -12,10 +12,15 @@ githubTag="ghcr.io/${GITHUB_REPOSITORY}/${dockerTag#*/}" shift shift +echo "ci/build-docker-image.sh dockerFile=\"$dockerFile\" dockerTag=\"$dockerTag\" githubTag=\"$githubTag\"" + scripts="$(dirname "$0")" +echo "Pulling $githubTag" "$scripts"/custom-timeout.sh 20 docker pull "${githubTag}" || true + echo "Building $githubTag" "$scripts"/custom-timeout.sh 30 docker build "$@" --build-arg REPOSITORY=${GITHUB_REPOSITORY} -f "${dockerFile}" -t "${githubTag}" --cache-from "${githubTag}" . + echo "Tagging ${dockerTag} from ${githubTag}" docker tag $githubTag $dockerTag