Skip to content

Update build tools #101

Update build tools

Update build tools #101

Workflow file for this run

name: CI
# Run tests on pull requests and after "merges"
on:
push:
branches: [main]
pull_request:
branches: [main]
# Allow manually triggering a run in the github ui.
# See: https://docs.github.com/en/actions/using-workflows/manually-running-a-workflow
workflow_dispatch: {}
jobs:
# Do a build/compile smoke test
build:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v5
with:
go-version: "stable"
- uses: actions/checkout@v4
- name: Build
run: make
# Run static/code-quality checks
check:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v5
with:
go-version: "stable"
- uses: actions/checkout@v4
- name: Install build tools
run: make build-tools
- name: Run checks
run: make check
check-commits:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: Ensure branches
run: git fetch
- name: Lint git commit messages
run: make check-gitlint
test:
needs: [build, check]
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v5
with:
go-version: "stable"
- uses: actions/checkout@v4
- name: Run tests
run: make test
podmanbuild:
runs-on: ubuntu-latest
# don't run on push, since the "push" job contains the
# image build step, so no need to do it twice.
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4
- name: Install fuse-overlayfs
run: sudo apt-get -y install fuse-overlayfs
- name: Setup podman config
run: |
mkdir -p /home/runner/.config/containers/
cat >/home/runner/.config/containers/storage.conf <<EOF
[storage]
driver = "overlay"
graphroot = "${HOME}/.local/share/containers/storage2"
[storage.options]
mount_program = "/usr/bin/fuse-overlayfs"
EOF
cat >/home/runner/.config/containers/containers.conf <<EOF
[containers]
netns = "host"
EOF
- name: build container image
# note: forcing use of podman here since we are
# using podman explicitly for the push job
run: make CONTAINER_CMD=podman image-build
dockerbuild:
runs-on: ubuntu-latest
# don't run on push, since the "push" job contains the
# image build step, so no need to do it twice.
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4
- name: build container image
# note: forcing use of podman here since we are
# using podman explicitly for the push job
run: make CONTAINER_CMD=docker image-build
# push the container to quay.io - only for pushes, not PRs
push:
needs: [build, check, test]
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v4
- name: log in to quay.io
# using docker for now, since podman has an issue with space
# consumption: image build fails with no space left on device...
run: echo "${{ secrets.QUAY_PASS }}" | docker login -u "${{ secrets.QUAY_USER }}" --password-stdin quay.io
- name: build container image
# note: forcing use of docker here, since we did docker login above
run: make CONTAINER_CMD=docker image-build
- name: push container image
# note: forcing use of docker here, since we did docker login above
run: make CONTAINER_CMD=docker image-push
- name: build dev container image
# note: forcing use of docker here, since we did docker login above
run: make CONTAINER_CMD=docker BASE_IMG_TAG=devbuilds-centos-amd64 image-build
- name: push dev container image
# note: forcing use of docker here, since we did docker login above
run: make CONTAINER_CMD=docker BASE_IMG_TAG=devbuilds-centos-amd64 image-push
- name: build ceph20 container image
# note: forcing use of docker here, since we did docker login above
run: make CONTAINER_CMD=docker BASE_IMG_TAG=ceph20-centos-amd64 image-build
- name: push ceph20 container image
# note: forcing use of docker here, since we did docker login above
run: make CONTAINER_CMD=docker BASE_IMG_TAG=ceph20-centos-amd64 image-push