Skip to content

ci: adding github actions to build and publish Galaxy #4

ci: adding github actions to build and publish Galaxy

ci: adding github actions to build and publish Galaxy #4

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: CI on Pull Request
on:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11"]
env:
CI_REGISTRY_IMAGE: "devrelyio/galaxy"
HELM_CHART_REGISTRY_DOMAIN: "registry-1.docker.io"
HELM_CHART_REGISTRY: "oci://${HELM_CHART_REGISTRY_DOMAIN}/devrelyio"
HELM_CHART_PATH: ./deploy/helm/galaxy
steps:
- name: Checkout repository
id: checkout
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
id: setup-python
uses: actions/setup-python@v5.2.0
with:
python-version: ${{ matrix.python-version }}
- name: Setup virtual environment with Poetry
id: setup-poetry-and-virtual-env
env:
GITHUB_PATH: ${{ github.path }}
VENV_PATH: "$GITHUB_PATH/.venv"
POETRY_HOME: "$GITHUB_PATH/.poetry"
BIN_PATH: "$GITHUB_PATH/.bin"
run: |
mkdir -p ${VENV_PATH} ${POETRY_HOME} ${BIN_PATH}
export PATH="${VENV_PATH}/bin:${POETRY_HOME}/bin:${BIN_PATH}:$PATH"
export PYTHONUNBUFFERED=1
export PYTHONDONTWRITEBYTECODE=1
export POETRY_VIRTUALENVS_IN_PROJECT=true
export POETRY_VIRTUALENVS_CREATE=true
sudo apt-get update && sudo apt-get install --no-install-recommends -y build-essential curl git
cp /usr/bin/make ${BIN_PATH}
- name: Install dependencies
id: install-dependencies
run: |
make install
- name: Run linter
id: run-linter
run: |
make lint
- name: Run tests
id: run-tests
run: |
make test
- name: Set up QEMU
id: setup-qemu
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
id: setup-docker-buildx
uses: docker/setup-buildx-action@v3
- name: Docker Login
id: docker-login
uses: docker/login-action@v3.3.0
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_SECRET }}
- name: describe tags
id: describe_tags
run: |
echo "IMAGE_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "0.0.0")-build.${GITHUB_RUN_ID}-${GITHUB_SHA}" >> "$GITHUB_OUTPUT"
- name: Build docker image
id: build-docker-image
uses: docker/build-push-action@v6
with:
file: deploy/docker/Dockerfile
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ${{ env.CI_REGISTRY_IMAGE }}:${{ steps.describe_tags.outputs.IMAGE_TAG }}
platforms: linux/amd64,linux/arm64
- name: Package Helm Chart for Validation
id: package-helm-chart
run: |
sed -i "s+repository.*+repository:\ $CI_REGISTRY_IMAGE+g" $HELM_CHART_PATH/values.yaml
sed -i "s+tag.*+tag:\ 0.0.0+g" $HELM_CHART_PATH/values.yaml
cat $HELM_CHART_PATH/values.yaml
helm package $HELM_CHART_PATH -d . --version 0.0.0