Skip to content

Commit

Permalink
Adds github actions pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
gurkanindibay committed Sep 6, 2021
1 parent aca3283 commit 6a8a752
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 29 deletions.
76 changes: 76 additions & 0 deletions .github/workflows/build-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Build Package

env:
CURRENT_BRANCH: ${GITHUB_REF##*/}
GH_TOKEN: "${{ secrets.GH_TOKEN }}"
PACKAGING_SECRET_KEY: "${{ secrets.PACKAGING_SECRET_KEY }}"
PACKAGE_CLOUD_REPO_NAME: "sample"
PACKAGE_ENCRYPTION_KEY: "${{ secrets.PACKAGE_ENCRYPTION_KEY }}"
PACKAGING_PASSPHRASE: "${{ secrets.PACKAGING_PASSPHRASE }}"
on:
push:
branches: "**"

workflow_dispatch:

jobs:
build_package:
name: Build package
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
TARGET_PLATFORM:
- centos,8
- centos,7
- debian,buster
- debian,stretch
- oraclelinux,8
- oraclelinux,7
- ubuntu,focal
- ubuntu,bionic
- ubuntu,xenial
- pgxn

steps:
- name: Export target platform
run: echo $TARGET_PLATFORM > os-list.csv

- name: Pwd0
run: echo $(pwd)

- name: Checkout repository
uses: actions/checkout@v2

- name: Install package dependencies
run: sudo apt-get update && sudo apt install libcurl4-openssl-dev libssl-dev

- name: Pwd
run: echo $(pwd)

- name: Update and check dockerfiles
run: |
./update_dockerfiles
git add --intent-to-add dockerfiles
git diff --exit-code dockerfiles
- name: Build images
run: |
git checkout -- dockerfiles
./update_images
- name: Clone tools repo for test
run: git clone -b develop_tests --depth=1 https://github.com/citusdata/tools.git tools

- name: Pwd 2
run: echo $(pwd)

- name: Execute packaging tests
run: |
python -m pip install -r tools/packaging_automation/requirements.txt
python -m pytest -q tools/packaging_automation/tests/test_citus_package.py -k 'test_build_packages'
env:
PACKAGING_IMAGE_PLATFORM: "${{matrix.TARGET_PLATFORM}}"

- name: Push images
run: ./ci/push_images
27 changes: 0 additions & 27 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions ci/push_images
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ badusage=64

nprocs="${1:-1}"

if [[ $TRAVIS_PULL_REQUEST != "false" ]] || [[ $TRAVIS_BRANCH != "develop" ]] ; then
if [[ ${CURRENT_BRANCH} != "develop" ]] ; then
echo "PR is not merged to develop, not pushing to DockerHub"
exit 0;
fi

echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
echo "${DOCKERHUB_PASSWORD}" | docker login -u "${DOCKERHUB_USERNAME}" --password-stdin

declare args

Expand Down

0 comments on commit 6a8a752

Please sign in to comment.