diff options
author | thecalcaholic <6317548+theCalcaholic@users.noreply.github.com> | 2022-09-28 21:40:19 +0300 |
---|---|---|
committer | thecalcaholic <6317548+theCalcaholic@users.noreply.github.com> | 2022-09-28 21:40:19 +0300 |
commit | 6906c5072974a836abfad4fa6315de67625950c4 (patch) | |
tree | fedaf76aa973180ea77217fa2d47c64f83793bcd | |
parent | a6aaa4abe8a2df9d8b3255eaae5ba16d1a616ccf (diff) |
build-docker.yml: Use inputs instead of matrix strategy for speeding up builds
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
-rw-r--r-- | .github/workflows/build-docker.yml | 55 | ||||
-rw-r--r-- | .github/workflows/release.yml | 19 |
2 files changed, 35 insertions, 39 deletions
diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index bae34c1d..726ed29b 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -10,6 +10,9 @@ on: git_ref: required: true type: string + arch: + required: true + type: string push: branches: - master @@ -23,13 +26,6 @@ jobs: build: if: ${{ github.repository == 'nextcloud/nextcloudpi' }} runs-on: ubuntu-latest - strategy: - matrix: - arch: - - x86 - - armhf - - arm64 - fail-fast: false env: VERSION: "${{ inputs.git_ref || github.ref }}" steps: @@ -53,28 +49,21 @@ jobs: - name: Build images id: build-container run: | - ./build/build-docker.sh "${{ matrix.arch }}" - docker tag "ownyourbits/nextcloudpi-${{ matrix.arch }}:latest" "thecalcaholic/ncp-internal-${{ matrix.arch }}:${{ github.run_id }}" - testing_image="ownyourbits/nextcloudpi-${{ matrix.arch }}:latest" - [[ "${{ matrix.arch }}" == "arm64" ]] && testing_image="ownyourbits/ncp-qemu-fix-${{ matrix.arch }}:latest" - docker tag "${testing_image}" "thecalcaholic/ncp-internal-${{ matrix.arch }}:${{ github.run_id }}-testing" - docker push "thecalcaholic/ncp-internal-${{ matrix.arch }}:${{ github.run_id }}" - docker push "thecalcaholic/ncp-internal-${{ matrix.arch }}:${{ github.run_id }}-testing" + ./build/build-docker.sh "${{ inputs.arch }}" + docker tag "ownyourbits/nextcloudpi-${{ inputs.arch }}:latest" "thecalcaholic/ncp-internal-${{ inputs.arch }}:${{ github.run_id }}" + testing_image="ownyourbits/nextcloudpi-${{ inputs.arch }}:latest" + [[ "${{ inputs.arch }}" == "arm64" ]] && testing_image="ownyourbits/ncp-qemu-fix-${{ inputs.arch }}:latest" + docker tag "${testing_image}" "thecalcaholic/ncp-internal-${{ inputs.arch }}:${{ github.run_id }}-testing" + docker push "thecalcaholic/ncp-internal-${{ inputs.arch }}:${{ github.run_id }}" + docker push "thecalcaholic/ncp-internal-${{ inputs.arch }}:${{ github.run_id }}-testing" - update-from-latest: + update-test: needs: - build runs-on: ubuntu-latest env: VERSION: "${{ inputs.git_ref || github.ref }}" - strategy: - matrix: - arch: - - armhf - - x86 - - arm64 - fail-fast: false steps: - name: Set up QEMU uses: docker/setup-qemu-action@v1 @@ -82,7 +71,7 @@ jobs: - name: Start ncp container run: | docker volume create ncdata - docker run --platform "linux/${{ matrix.arch }}" -v ncdata:/data -d --rm -p 8443:443 -p 4443:4443 --name nextcloudpi ownyourbits/nextcloudpi:latest + docker run --platform "linux/${{ inputs.arch }}" -v ncdata:/data -d --rm -p 8443:443 -p 4443:4443 --name nextcloudpi ownyourbits/nextcloudpi:latest - name: Checkout code uses: actions/checkout@v3 @@ -104,7 +93,7 @@ jobs: docker logs -f nextcloudpi |& awk '{ print "CONTAINER::" $0 }' & docker exec nextcloudpi bash -c 'tail -f /var/log/ncp.log' |& awk '{ print "NCP::" $0 }' & cmd=(python activation_tests.py --no-gui localhost 8443 4443) - [[ "${{ matrix.arch }}" == "x86" ]] || cmd+=(--timeout 300) + [[ "${{ inputs.arch }}" == "x86" ]] || cmd+=(--timeout 300) success=false for attempt in {1..3} @@ -128,7 +117,7 @@ jobs: - name: Start new container run: | docker stop nextcloudpi - docker run -d -v ncdata:/data --rm -p 8443:443 -p 4443:4443 --name nextcloudpi thecalcaholic/ncp-internal-${{ matrix.arch }}:${{ github.run_id }}-testing + docker run -d -v ncdata:/data --rm -p 8443:443 -p 4443:4443 --name nextcloudpi thecalcaholic/ncp-internal-${{ inputs.arch }}:${{ github.run_id }}-testing - name: Integration Tests working-directory: ./tests run: | @@ -137,7 +126,7 @@ jobs: docker logs -f nextcloudpi |& awk '{ print "CONTAINER::" $0 }' & docker exec nextcloudpi bash -c 'tail -f /var/log/ncp.log' |& awk '{ print "NCP::" $0 }' & cmd=(python activation_tests.py --no-gui localhost 8443 4443) - [[ "${{ matrix.arch }}" == "x86" ]] || cmd+=(--timeout 300) + [[ "${{ inputs.arch }}" == "x86" ]] || cmd+=(--timeout 300) success=false for attempt in {1..3} @@ -173,9 +162,6 @@ jobs: exit 1 } echo "CI:: Nextcloud test successful" - - - test: needs: @@ -184,13 +170,6 @@ jobs: env: VERSION: "${{ inputs.git_ref || github.ref }}" - strategy: - matrix: - arch: - - armhf - - x86 - - arm64 - fail-fast: false steps: - name: Set up QEMU uses: docker/setup-qemu-action@v1 @@ -200,7 +179,7 @@ jobs: echo "${{ secrets.DOCKER_PASSWORD_INTERNAL }}" | docker login -u "${{ secrets.DOCKER_LOGIN_INTERNAL }}" --password-stdin - name: Start ncp container run: | - docker run -d --rm -p 8443:443 -p 4443:4443 --name nextcloudpi thecalcaholic/ncp-internal-${{ matrix.arch }}:${{ github.run_id }}-testing + docker run -d --rm -p 8443:443 -p 4443:4443 --name nextcloudpi thecalcaholic/ncp-internal-${{ inputs.arch }}:${{ github.run_id }}-testing - name: Checkout code uses: actions/checkout@v3 @@ -222,7 +201,7 @@ jobs: docker logs -f nextcloudpi |& awk '{ print "CONTAINER::" $0 }' & docker exec nextcloudpi bash -c 'tail -f /var/log/ncp.log' |& awk '{ print "NCP::" $0 }' & cmd=(python activation_tests.py --no-gui localhost 8443 4443) - [[ "${{ matrix.arch }}" == "x86" ]] || cmd+=(--timeout 300) + [[ "${{ inputs.arch }}" == "x86" ]] || cmd+=(--timeout 300) success=false for attempt in {1..3} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6ddf9f15..f950991f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -47,11 +47,28 @@ jobs: git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}" secrets: inherit - docker: + docker-x86: if: ${{ inputs.docker || github.event_name != 'workflow_dispatch' }} uses: ./.github/workflows/build-docker.yml with: git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}" + arch: "x86" + secrets: inherit + + docker-armhf: + if: ${{ inputs.docker || github.event_name != 'workflow_dispatch' }} + uses: ./.github/workflows/build-docker.yml + with: + git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}" + arch: "armhf" + secrets: inherit + + docker-arm64: + if: ${{ inputs.docker || github.event_name != 'workflow_dispatch' }} + uses: ./.github/workflows/build-docker.yml + with: + git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}" + arch: "arm64" secrets: inherit test-curl-installer: |