Skip to content

Commit

Permalink
feat(ci): Add Build Scripts and Github Workflows (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
mayurinehate authored Nov 8, 2022
1 parent 815aa26 commit 27e157c
Show file tree
Hide file tree
Showing 61 changed files with 2,458 additions and 659 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: build & test
on:
push:
branches:
- main
paths-ignore:
- "docs/**"
- "**.md"
pull_request:
branches:
- main
paths-ignore:
- "docs/**"
- "**.md"
release:
types: [published, edited]

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: "3.9.9"
- name: Test packages are correct
run: |
cd datahub-classify;
python -c 'import setuptools; where="./src"; assert setuptools.find_packages(where) == setuptools.find_namespace_packages(where), "you seem to be missing or have extra __init__.py files"'
- name: Gradle build (and test)
run: |
./gradlew build
- uses: actions/upload-artifact@v2
if: always()
with:
name: Test Results (build)
path: |
**/build/reports/tests/test/**
**/build/test-results/test/**
**/junit.*.xml
event-file:
runs-on: ubuntu-latest
steps:
- name: Upload
uses: actions/upload-artifact@v2
with:
name: Event File
path: ${{ github.event_path }}
42 changes: 42 additions & 0 deletions .github/workflows/pypi-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: pypi-release datahub-classify
on:
release:
types: [published]

jobs:
setup:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.tag.outputs.tag }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Compute Tag
id: tag
run: |
echo "GITHUB_REF: $GITHUB_REF"
SHORT_SHA=$(git rev-parse --short "$GITHUB_SHA")
TAG=$(echo ${GITHUB_REF} | sed -e 's,refs/tags/v,,g' -e 's,refs/tags/acryl,,g')
echo "tag=$TAG"
echo "::set-output name=tag::$TAG"
push_to_pypi:
name: Build and push python package to PyPI
runs-on: ubuntu-latest
needs: setup
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9.9'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine build
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
run: |
cd datahub-actions
RELEASE_VERSION=${{ needs.setup.outputs.tag }} ./scripts/release.sh
8 changes: 5 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
__pycache__/
/venv*/
*.egg-info/
.gradle/

#VS Code
.vscode
.devcontainer
93 changes: 0 additions & 93 deletions README.md

This file was deleted.

37 changes: 37 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/**
* Copyright 2021 Acryl Data, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

buildscript {
apply from: './repositories.gradle'
buildscript.repositories.addAll(project.repositories)
}

project.ext.externalDependency = [
]

allprojects {
apply plugin: 'idea'
apply plugin: 'eclipse'
apply plugin: 'checkstyle'
}

subprojects {
tasks.withType(Test) {
if (!name.startsWith('integ')) {
useTestNG()
}
}
}
9 changes: 9 additions & 0 deletions datahub-classify/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
__pycache__/
/venv*/
*.egg-info/

#VS Code
.vscode
.devcontainer

.coverage
Loading

0 comments on commit 27e157c

Please sign in to comment.