re-export? #27
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 }} | |
repo-name: ${{ steps.prepare.outputs.repo-name }} | |
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 }} | |
ghcr.io/${{ steps.prepare.outputs.repo-name }}/builder:latest | |
cache-from: type=registry,ref=ghcr.io/${{ steps.prepare.outputs.repo-name }}/builder:latest | |
cache-to: type=inline | |
build-depends: | |
name: Build Dependencies | |
needs: builder-image | |
runs-on: ubuntu-20.04 | |
outputs: | |
image-tag: ${{ needs.builder-image.outputs.image-tag }} | |
repo-name: ${{ needs.builder-image.outputs.repo-name }} | |
strategy: | |
matrix: | |
host: | |
- arm-linux-gnueabihf | |
- x86_64-w64-mingw32 | |
- x86_64-pc-linux-gnu | |
container: | |
image: ghcr.io/${{ needs.builder-image.outputs.repo-name }}/builder:${{ needs.builder-image.outputs.image-tag }} | |
options: --user root | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Build dependencies | |
run: make -j$(nproc) -C depends HOST=${{ matrix.host }} | |
build: | |
name: Build | |
needs: build-depends | |
runs-on: ubuntu-20.04 | |
outputs: | |
image-tag: ${{ needs.builder-image.outputs.image-tag }} | |
repo-name: ${{ needs.builder-image.outputs.repo-name }} | |
strategy: | |
matrix: | |
include: | |
- build_target: arm-linux | |
- build_target: win64 | |
- build_target: linux64 | |
dep_opts: DEBUG=1 | |
container: | |
image: ghcr.io/${{ needs.builder-image.outputs.repo-name }}/builder:${{ needs.builder-image.outputs.image-tag }} | |
options: --user root | |
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/${{ needs.builder-image.outputs.repo-name }}/builder:${{ needs.builder-image.outputs.image-tag }} | |
options: --user root | |
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 |