-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
128 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,14 +4,9 @@ on: | |
branches: | ||
- master | ||
paths-ignore: | ||
- .readthedocs.yaml | ||
- '**.md' | ||
pull_request: | ||
branches: | ||
- master | ||
paths-ignore: | ||
- .readthedocs.yaml | ||
- '**.md' | ||
- doc/* | ||
jobs: | ||
test: | ||
name: Test | ||
|
@@ -24,8 +19,8 @@ jobs: | |
- '3.7' | ||
- '3.8' | ||
- '3.9' | ||
# - '3.10' 3.10+ require moving off of nose (https://github.com/nose-devs/nose/issues/1099) | ||
# - '3.11' | ||
- '3.10' | ||
- '3.11' | ||
steps: | ||
- name: Check out | ||
uses: actions/checkout@v3 | ||
|
@@ -38,6 +33,11 @@ jobs: | |
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Extract version | ||
id: extract-version | ||
run: | | ||
PACKAGE_VERSION="$(./scripts/version.sh)" | ||
echo "version=$PACKAGE_VERSION" >>"$GITHUB_OUTPUT" | ||
- name: Download Hadoop | ||
run: | | ||
echo "HADOOP_HOME=$(./scripts/hadoop.sh download)" >>"$GITHUB_ENV" | ||
|
@@ -56,6 +56,22 @@ jobs: | |
run: HDFSCLI_TEST_URL="$WEBHDFS_URL" python -m pytest --cov=hdfs | ||
- name: Test on HTTPFS | ||
run: HDFSCLI_TEST_URL="$HTTPFS_URL" HDFSCLI_NOSNAPSHOT=1 python -m pytest --cov=hdfs | ||
- name: Check if tag exists | ||
uses: mukunku/[email protected] | ||
id: check-version | ||
with: | ||
tag: v${{ steps.extract-version.outputs.version }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Create tag | ||
if: steps.check-version.outputs.exists == 'false' | ||
uses: pkgdeps/git-tag-action@v2 | ||
with: | ||
git_commit_sha: ${{ github.sha }} | ||
git_tag_prefix: v | ||
github_repo: ${{ github.repository }} | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
version: ${{ steps.extract-version.outputs.version }} | ||
- name: Stop HDFS | ||
if: always() | ||
run: ./scripts/hadoop.sh stop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: PR | ||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
paths-ignore: | ||
- '**.md' | ||
- .readthedocs.yaml | ||
- doc/* | ||
jobs: | ||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: | ||
# - '3.6' (see https://github.com/actions/setup-python/issues/544) | ||
- '3.7' | ||
- '3.8' | ||
- '3.9' | ||
- '3.10' | ||
- '3.11' | ||
steps: | ||
- name: Check out | ||
uses: actions/checkout@v3 | ||
- name: Setup Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'adopt' | ||
java-version: '8' | ||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Download Hadoop | ||
run: | | ||
echo "HADOOP_HOME=$(./scripts/hadoop.sh download)" >>"$GITHUB_ENV" | ||
- name: Configure Hadoop | ||
run: | | ||
echo "HADOOP_CONF_DIR=$(./scripts/hadoop.sh config)" >>"$GITHUB_ENV" | ||
- name: Start HDFS | ||
run: | | ||
./scripts/hadoop.sh start | ||
echo "WEBHDFS_URL=http://$("$HADOOP_HOME/bin/hdfs" getconf -confKey dfs.namenode.http-address)" >>"$GITHUB_ENV" | ||
echo "HTTPFS_URL=http://localhost:14000" >>"$GITHUB_ENV" | ||
sleep 5 # TODO: Find a better way to wait for all datanodes to become reachable. | ||
- name: Install | ||
run: pip install .[avro] coverage mock pytest pytest-cov pandas | ||
- name: Test on WebHDFS | ||
run: HDFSCLI_TEST_URL="$WEBHDFS_URL" python -m pytest --cov=hdfs | ||
- name: Test on HTTPFS | ||
run: HDFSCLI_TEST_URL="$HTTPFS_URL" HDFSCLI_NOSNAPSHOT=1 python -m pytest --cov=hdfs | ||
- name: Stop HDFS | ||
if: always() | ||
run: ./scripts/hadoop.sh stop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Release | ||
on: | ||
release: | ||
types: | ||
- published | ||
jobs: | ||
test: | ||
name: Publish | ||
timeout-minutes: 2 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out | ||
uses: actions/checkout@v2 | ||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
- name: Publish | ||
run: | | ||
python setup.py sdist | ||
twine upload dist/* | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -o nounset | ||
set -o errexit | ||
set -o pipefail | ||
shopt -s nullglob | ||
|
||
__dirname="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
|
||
fail() { # MSG | ||
echo "$1" >&2 && exit 1 | ||
} | ||
|
||
version_pattern="__version__ = '([^']+)'" | ||
|
||
main() { | ||
cd "$__dirname/.." | ||
local line="$(grep __version__ hdfs/__init__.py)" | ||
if ! [[ $line =~ $version_pattern ]]; then | ||
fail 'missing version' | ||
fi | ||
echo "${BASH_REMATCH[1]}" | ||
} | ||
|
||
main "$@" |