Skip to content

Workaround git directory ownership in CI. #99

Workaround git directory ownership in CI.

Workaround git directory ownership in CI. #99

Workflow file for this run

name: CI
on:
push:
pull_request:
workflow_dispatch:
pull_request:
types:
- opened
jobs:
whitebox-test:
runs-on: ubuntu-latest
steps:
# Note: unfortunately GitHub doesn't offer a good mechanism for step reuse (e.g. YAML anchors)
# Required for use of Docker layer cache
- name: Set up Docker Buildx (required for caching)
uses: docker/setup-buildx-action@v1
- name: Setup Docker layer cache
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.repository }}
restore-keys: ${{ runner.os }}-buildx-
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
- name: Build format checker
uses: docker/build-push-action@v2
with:
tags: colinnolan/video-frame-fuse:formatter
context: .
target: formatter
load: true
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache,mode=max
- name: Check format
run: docker run --rm -v "${PWD}:/checkout:ro" --entrypoint bash colinnolan/video-frame-fuse:formatter /checkout/scripts/test/run-style-check.sh
- name: Build tester
uses: docker/build-push-action@v2
with:
tags: colinnolan/video-frame-fuse:tester
context: .
target: tester
load: true
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache,mode=max
- name: Run unit tests
run: docker run --rm -v "${PWD}:/checkout" colinnolan/video-frame-fuse:tester /checkout/scripts/test/run-unit-tests.sh
build:
runs-on: ubuntu-latest
steps:
# Note: unfortunately GitHub doesn't offer a good mechanism for step reuse (e.g. YAML anchors)
# Required for use of Docker layer cache
- name: Set up Docker Buildx (required for caching)
uses: docker/setup-buildx-action@v1
- name: Setup Docker layer cache
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.repository }}
restore-keys: ${{ runner.os }}-buildx-
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
- name: Build builder
uses: docker/build-push-action@v2
with:
tags: colinnolan/video-frame-fuse:builder
context: .
target: builder
load: true
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache,mode=max
- name: Build binary
run: docker run --rm -v "${PWD}:/checkout" colinnolan/video-frame-fuse:builder /checkout/scripts/build/run-release-build.sh
- name: Upload binary
uses: actions/upload-artifact@v2
with:
name: video-frame-fuse
path: target/release/video-frame-fuse
blackbox-test:
needs: build
runs-on: ubuntu-latest
steps:
# Note: unfortunately GitHub doesn't offer a good mechanism for step reuse (e.g. YAML anchors)
# Required for use of Docker layer cache
- name: Set up Docker Buildx (required for caching)
uses: docker/setup-buildx-action@v1
- name: Setup Docker layer cache
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.repository }}
restore-keys: ${{ runner.os }}-buildx-
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
- name: Build tester
uses: docker/build-push-action@v2
with:
tags: colinnolan/video-frame-fuse:tester
context: .
target: tester
load: true
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache,mode=max
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: video-frame-fuse
path: target/release/
- name: Run tests
run: |
chmod +x ./target/release/video-frame-fuse
docker run --privileged --rm -v "${PWD}:/checkout" colinnolan/video-frame-fuse:tester /checkout/scripts/test/run-acceptance-tests.sh