Skip to content

chore: update dependency download mirrors to reliable sources #6

chore: update dependency download mirrors to reliable sources

chore: update dependency download mirrors to reliable sources #6

Workflow file for this run

name: CI
on:
push:
branches: [develop, master]
pull_request:
branches: [develop]
env:
DOCKER_BUILDKIT: 1
COMPOSE_DOCKER_CLI_BUILD: 1
jobs:
builder-image:
name: Build Builder Image
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Cache Docker layers
uses: actions/cache@v5
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-builder-${{ hashFiles('ci/Dockerfile.builder') }}
restore-keys: |
${{ runner.os }}-buildx-builder-
- name: Build builder image
uses: docker/build-push-action@v7
with:
context: ./ci
file: ./ci/Dockerfile.builder
push: false
load: true
tags: gobyte-builder:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
- name: Save builder image
run: |
docker save gobyte-builder:latest | gzip > /tmp/gobyte-builder.tar.gz
- name: Upload builder image artifact
uses: actions/upload-artifact@v6
with:
name: builder-image
path: /tmp/gobyte-builder.tar.gz
retention-days: 3
build:
name: Build ${{ matrix.target }}
runs-on: ubuntu-22.04
needs: builder-image
strategy:
fail-fast: false
matrix:
include:
- target: arm-linux
host: arm-linux-gnueabihf
run_unit_tests: false
run_integration_tests: false
dep_opts: ""
- target: win32
host: i686-w64-mingw32
run_unit_tests: true
run_integration_tests: false
dep_opts: ""
- target: win64
host: x86_64-w64-mingw32
run_unit_tests: true
run_integration_tests: false
dep_opts: ""
- target: linux32
host: i686-pc-linux-gnu
run_unit_tests: true
run_integration_tests: true
dep_opts: ""
- target: linux64
host: x86_64-unknown-linux-gnu
run_unit_tests: true
run_integration_tests: true
dep_opts: "NO_UPNP=1 DEBUG=1"
- target: linux64_nowallet
host: x86_64-unknown-linux-gnu
run_unit_tests: true
run_integration_tests: false
dep_opts: "NO_WALLET=1"
- target: linux64_release
host: x86_64-unknown-linux-gnu
run_unit_tests: true
run_integration_tests: false
dep_opts: "NO_UPNP=1"
- target: mac
host: x86_64-apple-darwin11
run_unit_tests: false
run_integration_tests: false
dep_opts: ""
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Download builder image
uses: actions/download-artifact@v8
with:
name: builder-image
path: /tmp
- name: Load builder image
run: |
docker load < /tmp/gobyte-builder.tar.gz
- name: Set up cache directories
run: |
mkdir -p ${{ github.workspace }}/cache/ccache
mkdir -p ${{ github.workspace }}/cache/depends
mkdir -p ${{ github.workspace }}/cache/sdk-sources
mkdir -p ${{ github.workspace }}/cache/docker
- name: Cache build artifacts
uses: actions/cache@v5
with:
path: |
${{ github.workspace }}/cache/ccache
${{ github.workspace }}/cache/depends
${{ github.workspace }}/cache/sdk-sources
key: ${{ runner.os }}-${{ matrix.target }}-${{ hashFiles('depends/**', 'configure.ac', 'Makefile.am') }}
restore-keys: |
${{ runner.os }}-${{ matrix.target }}-
- name: Get commit info
id: commit-info
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
echo "pull_request=true" >> $GITHUB_OUTPUT
echo "commit_range=${{ github.event.pull_request.base.sha }}..${{ github.sha }}" >> $GITHUB_OUTPUT
else
echo "pull_request=false" >> $GITHUB_OUTPUT
echo "commit_range=HEAD~1..HEAD" >> $GITHUB_OUTPUT
fi
echo "job_number=${{ github.run_id }}-${{ github.run_attempt }}" >> $GITHUB_OUTPUT
- name: Build dependencies
run: |
docker run -t --rm \
--user "$(id -u):$(id -g)" \
-v ${{ github.workspace }}:${{ github.workspace }} \
-v ${{ github.workspace }}/cache:${{ github.workspace }}/cache \
-w ${{ github.workspace }} \
-e SRC_DIR=${{ github.workspace }} \
-e CACHE_DIR=${{ github.workspace }}/cache \
-e BUILD_TARGET=${{ matrix.target }} \
-e HOST=${{ matrix.host }} \
-e DEP_OPTS="${{ matrix.dep_opts }}" \
-e PULL_REQUEST=${{ steps.commit-info.outputs.pull_request }} \
-e COMMIT_RANGE=${{ steps.commit-info.outputs.commit_range }} \
-e JOB_NUMBER=${{ steps.commit-info.outputs.job_number }} \
-e PYTHON_DEBUG=1 \
gobyte-builder:latest \
./ci/build_depends.sh
- name: Build source
run: |
docker run -t --rm \
--user "$(id -u):$(id -g)" \
-v ${{ github.workspace }}:${{ github.workspace }} \
-v ${{ github.workspace }}/cache:${{ github.workspace }}/cache \
-w ${{ github.workspace }} \
-e SRC_DIR=${{ github.workspace }} \
-e CACHE_DIR=${{ github.workspace }}/cache \
-e BUILD_TARGET=${{ matrix.target }} \
-e HOST=${{ matrix.host }} \
-e DEP_OPTS="${{ matrix.dep_opts }}" \
-e PULL_REQUEST=${{ steps.commit-info.outputs.pull_request }} \
-e COMMIT_RANGE=${{ steps.commit-info.outputs.commit_range }} \
-e JOB_NUMBER=${{ steps.commit-info.outputs.job_number }} \
-e PYTHON_DEBUG=1 \
gobyte-builder:latest \
./ci/build_src.sh
- name: Run unit tests
if: matrix.run_unit_tests
run: |
docker run -t --rm \
--user "$(id -u):$(id -g)" \
-v ${{ github.workspace }}:${{ github.workspace }} \
-v ${{ github.workspace }}/cache:${{ github.workspace }}/cache \
-w ${{ github.workspace }} \
-e SRC_DIR=${{ github.workspace }} \
-e CACHE_DIR=${{ github.workspace }}/cache \
-e BUILD_TARGET=${{ matrix.target }} \
-e HOST=${{ matrix.host }} \
-e PULL_REQUEST=${{ steps.commit-info.outputs.pull_request }} \
-e COMMIT_RANGE=${{ steps.commit-info.outputs.commit_range }} \
-e JOB_NUMBER=${{ steps.commit-info.outputs.job_number }} \
-e TRAVIS_BUILD_ID="${{ github.run_id }}" \
-e PYTHON_DEBUG=1 \
gobyte-builder:latest \
./ci/test_unittests.sh
- name: Run integration tests
if: matrix.run_integration_tests
run: |
docker run -t --rm \
--user "$(id -u):$(id -g)" \
-v ${{ github.workspace }}:${{ github.workspace }} \
-v ${{ github.workspace }}/cache:${{ github.workspace }}/cache \
-w ${{ github.workspace }} \
-e SRC_DIR=${{ github.workspace }} \
-e CACHE_DIR=${{ github.workspace }}/cache \
-e BUILD_TARGET=${{ matrix.target }} \
-e HOST=${{ matrix.host }} \
-e PULL_REQUEST=${{ steps.commit-info.outputs.pull_request }} \
-e COMMIT_RANGE=${{ steps.commit-info.outputs.commit_range }} \
-e JOB_NUMBER=${{ steps.commit-info.outputs.job_number }} \
-e PYTHON_DEBUG=1 \
gobyte-builder:latest \
./ci/test_integrationtests.sh --quiet --jobs=3 --extended --exclude pruning,dbcrash
- name: Upload build artifacts
if: always()
uses: actions/upload-artifact@v6
with:
name: build-${{ matrix.target }}
path: ${{ github.workspace }}/build-ci
retention-days: 3
- name: Upload test logs
if: always() && (matrix.run_unit_tests || matrix.run_integration_tests)
uses: actions/upload-artifact@v6
with:
name: testlogs-${{ matrix.target }}
path: ${{ github.workspace }}/testlogs
retention-days: 3
if-no-files-found: ignore