Skip to content

Commit

Permalink
ci: add and fix build workflows (#1)
Browse files Browse the repository at this point in the history
* chore(ci): add test-make job
* chore(ci): fix docker-buildx job
* chore: add placeholder `make test`
  • Loading branch information
legobeat committed Jun 5, 2024
1 parent 12b013d commit 840256f
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 5 deletions.
49 changes: 44 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,66 @@ on:
jobs:
docker-buildx:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# test with nonstandard uid and gid
build-args:
- |
UID=1234
GID=1235
- |
UID=1000
GID=1000
- ''
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true

- name: Build and load
uses: docker/build-push-action@v5
with:
context: .
file: Containerfile
# test with nonstandard uid and gid
build-args: |
UID=1234
GID=1235
build-args: ${{ matrix.build-args }}
load: true
tags: l7/nvim:latest
# could enable push to gh registry
push: false
cache-from: type=gha
cache-to: type=gha,mode=max
test-make:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
cmd:
- ''
- docker
- podman
os:
- ubuntu-20.04
- ubuntu-22.04
- ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
submodules: true
- run: make IMAGE_NAME=localhost/foo IMAGE_TAG=bar CMD=${{ matrix.cmd }}
if: ${{ matrix.cmd != '' }}
env:
CMD: ${{ matrix.cmd }}
- run: make IMAGE_NAME=localhost/foo IMAGE_TAG=bar
if: ${{ matrix.cmd == '' }}
- run: ${{ matrix.cmd }} image inspect localhost/foo:bar
if: ${{ matrix.cmd != '' }}
- run: podman image inspect localhost/foo:bar
if: ${{ matrix.cmd == '' }}
- run: make test
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ image_nvim:
--build-arg "GID=${GID}" \
-t "${IMAGE_NAME}:${IMAGE_TAG}" \
.
test:
@echo TODO: tests

0 comments on commit 840256f

Please sign in to comment.