Skip to content

Commit

Permalink
Add a CI workflow to build the code
Browse files Browse the repository at this point in the history
Signed-off-by: Benoit Donneaux <[email protected]>
  • Loading branch information
btlogy committed Jun 3, 2024
1 parent 3761ce9 commit e98205d
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Go

jobs:
main:
name: Main
runs-on: ubuntu-22.04
permissions:
pull-requests: write
contents: read

steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4

- name: Verify Docker
id: verify_docker
run: |
docker run --rm hello-world:latest > /dev/null
docker rmi hello-world:latest > /dev/null
docker version
docker compose version
- name: Cache docker images
uses: ScribeMD/[email protected]
with:
key: |
docker-${{ runner.os }}-${{ hashFiles(
'docker-compose*.yml',
'docker/**'
) }}
- name: Fix goup membership
id: fix_group
run: |
# Add the existing `runner` group to avoid the `docker` one
sudo adduser runner runner
echo "_GID=$(grep -E "^runner:" /etc/group | cut -d: -f3)" >> $GITHUB_ENV
- name: Build images
id: build_images
run: |
docker compose build --progress=plain \
--build-arg uid=$(id -u) \
--build-arg gid=${_GID}
- name: Go make
id: go_make
run: |
docker compose run go-shell sh -c "make"

0 comments on commit e98205d

Please sign in to comment.