Skip to content

Ensures the handling of OPTARG is consistent with Bash’s getopts (#30) #42

Ensures the handling of OPTARG is consistent with Bash’s getopts (#30)

Ensures the handling of OPTARG is consistent with Bash’s getopts (#30) #42

Workflow file for this run

name: CI pipeline
on:
push:
branches: [master]
pull_request:
defaults:
run:
shell: bash
jobs:
build:
runs-on: ubuntu-latest
env:
DOCKER_IMAGE: ci/${{ github.job }}
BUILD_CACHE: /home/runner/.docker/buildkit
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ${{ env.BUILD_CACHE }}
key: ${{ hashFiles('Dockerfile') }}
- name: Install the latest buildkit release
run: |
BUILDKIT_URL="$(curl -sL https://api.github.com/repos/moby/buildkit/releases \
| jq -r 'map(select(.name|startswith("v")))|sort_by(.name)[-1].assets[]|select(.name|endswith(".linux-amd64.tar.gz")).browser_download_url')"
curl -L "${BUILDKIT_URL}" | sudo tar -xz -C /usr/local
- name: Start buildkit daemon
run: |
sudo --non-interactive --shell <<END_SUDO
install -d -m 0750 -o root -g docker /run/buildkit
buildkitd &
while ! test -S /run/buildkit/buildkitd.sock; do sleep 0.1; done
chgrp docker /run/buildkit/buildkitd.sock
END_SUDO
- name: Build docker image
run: |
buildctl build \
--frontend=dockerfile.v0 --local dockerfile=. --local context=. \
--opt build-arg:BUILD_DATE="$(date -u +"%Y-%m-%dT%TZ")" \
--opt build-arg:BUILD_SHA="$(git rev-parse HEAD)" \
--export-cache type=local,dest=${BUILD_CACHE},mode=max \
--import-cache type=local,src=${BUILD_CACHE} \
--output type=docker,name=${DOCKER_IMAGE} | docker load
echo "Cache size: $(du -sh ${BUILD_CACHE})"
- name: Prepare coverage report
run: ./bin/docker run ${DOCKER_IMAGE} cp -a /home/coverage /mnt/coverage
- uses: codecov/codecov-action@v5