Skip to content

Commit

Permalink
Add alpine support (#421)
Browse files Browse the repository at this point in the history
Co-authored-by: adamiBs <[email protected]>
  • Loading branch information
maxb-io and adamiBs authored Oct 29, 2024
1 parent 3e867f9 commit 6203acb
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 33 deletions.
26 changes: 16 additions & 10 deletions .github/actions/build-and-tag-locally/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ runs:
linux/arm/v5)
plaform_name="arm-v5"
;;
linux/arm/v6)
plaform_name="arm-v6"
;;
linux/arm/v7)
plaform_name="arm-v7"
;;
Expand All @@ -57,6 +60,9 @@ runs:
linux/ppc64le)
plaform_name="ppc64le"
;;
linux/riscv64)
plaform_name="riscv64"
;;
linux/s390x)
plaform_name="s390x"
;;
Expand Down Expand Up @@ -100,31 +106,31 @@ runs:
- name: Upload image
uses: actions/upload-artifact@v4
with:
name: ${{ steps.platform.outputs.display_name }}-docker-image.tar
name: ${{ steps.platform.outputs.display_name }}-${{ inputs.distribution }}-docker-image.tar
path: /tmp/image-${{ steps.platform.outputs.display_name }}.tar
retention-days: 45

- name: Run container
shell: bash
if: ${{ contains(fromJSON('["amd64", "arm64", "i386"]'), steps.platform.outputs.display_name) }}
if: ${{ contains(fromJSON('["amd64", "i386"]'), steps.platform.outputs.display_name) }}
run: |
docker run -d --name sanity-test-${{ steps.platform.outputs.display_name }} ${{ github.sha }}:${{ steps.platform.outputs.display_name }}
- name: Container Logs
if: ${{ contains(fromJSON('["amd64", "arm64", "i386"]'), steps.platform.outputs.display_name) }}
if: ${{ contains(fromJSON('["amd64", "i386"]'), steps.platform.outputs.display_name) }}
shell: bash
run: |
docker logs sanity-test-${{ steps.platform.outputs.display_name }}
- name: Sanity Tests
if: ${{ contains(fromJSON('["amd64", "arm64", "i386"]'), steps.platform.outputs.display_name) }}
if: ${{ contains(fromJSON('["amd64", "i386"]'), steps.platform.outputs.display_name) }}
shell: bash
run: |
docker exec sanity-test-${{ steps.platform.outputs.display_name }} redis-cli ping
docker exec sanity-test-${{ steps.platform.outputs.display_name }} redis-cli info server
- name: Verify installed modules
if: ${{ contains(fromJSON('["amd64", "arm64",]'), steps.platform.outputs.display_name) }}
if: ${{ contains(fromJSON('["amd64"]'), steps.platform.outputs.display_name) }}
shell: bash
run: |
modules=$(docker exec sanity-test-${{ steps.platform.outputs.display_name }} redis-cli module list)
Expand All @@ -144,7 +150,7 @@ runs:
fi
- name: Test RedisBloom
if: ${{ contains(fromJSON('["amd64", "arm64"]'), steps.platform.outputs.display_name) }}
if: ${{ contains(fromJSON('["amd64"]'), steps.platform.outputs.display_name) }}
shell: bash
run: |
docker exec sanity-test-${{ steps.platform.outputs.display_name }} redis-cli BF.ADD popular_keys "redis:hash"
Expand All @@ -154,7 +160,7 @@ runs:
echo "RedisBloom test passed successfully"
- name: Test RediSearch
if: ${{ contains(fromJSON('["amd64", "arm64"]'), steps.platform.outputs.display_name) }}
if: ${{ contains(fromJSON('["amd64"]'), steps.platform.outputs.display_name) }}
shell: bash
run: |
docker exec sanity-test-${{ steps.platform.outputs.display_name }} redis-cli FT.CREATE redis_commands ON HASH PREFIX 1 cmd: SCHEMA name TEXT SORTABLE description TEXT
Expand All @@ -169,7 +175,7 @@ runs:
fi
- name: Test RedisTimeSeries
if: ${{ contains(fromJSON('["amd64", "arm64"]'), steps.platform.outputs.display_name) }}
if: ${{ contains(fromJSON('["amd64"]'), steps.platform.outputs.display_name) }}
shell: bash
run: |
docker exec sanity-test-${{ steps.platform.outputs.display_name }} redis-cli TS.CREATE redis:cpu:usage RETENTION 86400
Expand All @@ -185,7 +191,7 @@ runs:
fi
- name: Test ReJSON
if: ${{ contains(fromJSON('["amd64", "arm64"]'), steps.platform.outputs.display_name) }}
if: ${{ contains(fromJSON('["amd64"]'), steps.platform.outputs.display_name) }}
shell: bash
run: |
docker exec sanity-test-${{ steps.platform.outputs.display_name }} redis-cli JSON.SET redis:config $ '{"maxmemory":"2gb","maxmemory-policy":"allkeys-lru"}'
Expand All @@ -200,7 +206,7 @@ runs:
- name: Push image
uses: docker/build-push-action@v6
if: ${{ inputs.publish_image == 'true' && contains(fromJSON('["amd64","arm64"]'), steps.platform.outputs.display_name) }}
if: ${{ inputs.publish_image == 'true' && contains(fromJSON('["amd64"]'), steps.platform.outputs.display_name) }}
with:
context: ${{ inputs.distribution }}
push: true
Expand Down
14 changes: 13 additions & 1 deletion .github/workflows/pre-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,27 @@ jobs:
matrix:
distribution:
- debian
#- alpine
- alpine
platform:
- linux/amd64
- linux/i386
- linux/arm/v5
- linux/arm/v6
- linux/arm/v7
- linux/mips64le
- linux/ppc64le
- linux/s390x
- linux/arm64
- linux/riscv64
exclude:
- distribution: alpine
platform: linux/mips64le
- distribution: alpine
platform: linux/arm/v5
- distribution: debian
platform: linux/riscv64
- distribution: debian
platform: linux/arm/v6
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down
1 change: 0 additions & 1 deletion .gitignore

This file was deleted.

62 changes: 44 additions & 18 deletions alpine/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions debian/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6203acb

Please sign in to comment.