lower #15
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
pull_request: | |
permissions: | |
contents: read | |
packages: write | |
env: | |
DOCKER_DRIVER: overlay2 | |
FAST_MODE: false | |
jobs: | |
builder-image: | |
name: Builder Image | |
runs-on: ubuntu-20.04 | |
outputs: | |
image-tag: ${{ steps.prepare.outputs.image-tag }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Prepare | |
id: prepare | |
run: | | |
BRANCH_NAME=$(echo "${GITHUB_REF##*/}" | tr '[:upper:]' '[:lower:]') | |
REPO_NAME=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]') | |
echo "::set-output name=image-tag::${BRANCH_NAME}" | |
echo "::set-output name=repo-name::${REPO_NAME}" | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v2 | |
with: | |
context: ./contrib/containers/ci | |
file: ./contrib/containers/ci/Dockerfile | |
push: true | |
tags: ghcr.io/${{ steps.prepare.outputs.repo-name }}/builder:${{ steps.prepare.outputs.image-tag }} | |
build-depends: | |
name: Build Dependencies | |
needs: builder-image | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
include: | |
- host: arm-linux-gnueabihf | |
- host: x86_64-w64-mingw32 | |
- host: x86_64-pc-linux-gnu | |
dep_opts: DEBUG=1 | |
container: | |
image: ghcr.io/${{ github.repository }}/builder:${{ needs.builder-image.outputs.image-tag }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Build dependencies | |
run: make -j$(nproc) -C depends HOST=${{ matrix.host }} ${{ matrix.dep_opts || '' }} | |
build: | |
name: Build | |
needs: build-depends | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
include: | |
- build_target: arm-linux | |
- build_target: win64 | |
- build_target: linux64 | |
dep_opts: DEBUG=1 | |
container: | |
image: ghcr.io/${{ github.repository }}/builder:${{ needs.builder-image.outputs.image-tag }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup environment | |
run: | | |
echo "BUILD_TARGET=${{ matrix.build_target }}" | |
source ./ci/dash/matrix.sh | |
- name: Build source and run tests | |
run: | | |
./ci/dash/build_src.sh | |
./ci/dash/test_unittests.sh | |
test: | |
name: Test | |
needs: build | |
runs-on: ubuntu-20.04 | |
container: | |
image: ghcr.io/${{ github.repository }}/builder:${{ needs.builder-image.outputs.image-tag }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup environment | |
run: | | |
echo "BUILD_TARGET=${{ needs.build.matrix.build_target }}" | |
source ./ci/dash/matrix.sh | |
- name: Run integration tests | |
run: ./ci/dash/test_integrationtests.sh --extended --exclude feature_pruning,feature_dbcrash |