gha: build packages (#4607)

This commit is contained in:
Ruslan Kuprieiev
2020-09-24 14:48:04 +03:00
committed by GitHub
parent 46bc89319a
commit 2457633990
13 changed files with 132 additions and 312 deletions
-30
View File
@@ -1,30 +0,0 @@
#!/bin/bash
set -e
set -x
if [ ! -d "dvc" ]; then
echo "Please run this script from repository root"
exit 1
fi
sg lxd -c snapcraft
pip uninstall -y dvc
if which dvc; then
echo "ERROR: dvc command still exists! Unable to verify dvc version." >&2
exit 1
fi
sudo snap install --dangerous --classic dvc_*.snap
if [[ -n "$TRAVIS_TAG" ]]; then
# Make sure we have a correct version
if [[ "$(dvc --version)" != "$TRAVIS_TAG" ]]; then
echo "ERROR: 'dvc --version'$(dvc -V) doesn't match '$TRAVIS_TAG'" >&2
exit 1
fi
fi
# ensure basic commands can run
# N.B.: cannot run `dvc get` on travis (#2956)
dvc version
dvc.git status
dvc.git fetch --all
sudo snap remove dvc
-53
View File
@@ -1,53 +0,0 @@
#!/bin/bash
set -x
set -e
scriptdir="$(dirname $0)"
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
ulimit -a
sudo sysctl -w kern.maxproc=2048
sudo sysctl -w kern.maxprocperuid=2048
echo '\nulimit -u 2048' >>~/.bash_profile
ulimit -a
fi
echo >env.sh
if [[ "$TRAVIS_BUILD_STAGE_NAME" == "test" ]]; then
if [[ "$TRAVIS_OS_NAME" == "osx" && "$TRAVIS_PULL_REQUEST" == "false" ]]; then
brew install openssl
$scriptdir/retry.sh brew cask install google-cloud-sdk
fi
fi
if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then
$scriptdir/retry.sh choco install python --version $PYTHON_VERSION
echo "PATH='$PATH'" >>env.sh
elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
ln -s -f /usr/local/bin/python3 /usr/local/bin/python
ln -s -f /usr/local/bin/pip3 /usr/local/bin/pip
fi
if [ "$TRAVIS_OS_NAME" == "linux" ]; then
# fetch tags for `git-describe`, since
# - can't rely on $TRAVIS_TAG for snapcraft `edge` (master) releases, and
# - `snapcraft` also uses `git-describe` for version detection
git fetch --tags
TAG_MAJOR="$(git describe --tags | sed -r 's/^v?([0-9]+)\.[0-9]+\.[0-9]+.*/\1/')"
[[ -n "$TAG_MAJOR" ]] || exit 1 # failed to detect major version
if [[ -n "$TRAVIS_TAG" ]]; then
if [[ $(echo "$TRAVIS_TAG" | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$') ]]; then
SNAP_CHANNEL=stable
else
SNAP_CHANNEL=beta
fi
else
SNAP_CHANNEL=edge
fi
echo "export SNAP_CHANNEL=${SNAP_CHANNEL},v${TAG_MAJOR}/${SNAP_CHANNEL}" >>env.sh
# NOTE: after deprecating this major version branch, uncomment this line
# echo "export SNAP_CHANNEL=v${TAG_MAJOR}/${SNAP_CHANNEL}" >>env.sh
fi
-12
View File
@@ -1,12 +0,0 @@
#!/bin/bash
set -x
set -e
pip install Pygments collective.checkdocs pre-commit .
# stop the build if there are any readme formatting errors
python setup.py checkdocs
# stop the build if there are any formatting errors
pre-commit run --all-files
-18
View File
@@ -1,18 +0,0 @@
#!/bin/bash
set -e
set -x
if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then
where python
where pip
else
which python
which pip
fi
py_ver="$(python -c 'import sys; print(sys.version[0])')"
if [[ "$py_ver" != 3 ]]; then
exit 1
fi
-15
View File
@@ -1,15 +0,0 @@
#!/bin/bash
set -e
if [[ $TRAVIS_EVENT_TYPE = pull_request || $TRAVIS_EVENT_TPYE = cron ]]; then
exit 2
fi
# positional args are assumed to be file glob patterns to deploy
if [[ ${#} -ge 1 ]]; then
# ensure at least one file exists
[[ -n "$(ls $@ 2>/dev/null)" ]] || exit 3
fi
echo true
Binary file not shown.
-22
View File
@@ -1,22 +0,0 @@
#!/bin/bash
set -x
set -e
scriptdir="$(dirname $0)"
# NOTE: it is not uncommon for pip to hang on travis for what seems to be
# networking issues. Thus, let's retry a few times to see if it will eventually
# work or not.
$scriptdir/retry.sh pip install .[all,tests]
git config --global user.email "[email protected]"
git config --global user.name "DVC Tester"
if [[ "$TRAVIS_SECURE_ENV_VARS" == "true" ]]; then
aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID
aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY
aws configure set region us-west-2
openssl enc -d -aes-256-cbc -md md5 -k $GCP_CREDS -in scripts/ci/gcp-creds.json.enc -out scripts/ci/gcp-creds.json
fi
-11
View File
@@ -1,11 +0,0 @@
#!/bin/bash
set -e
N_RETRIES=3
for i in $(seq $N_RETRIES); do
echo "Attempt #$i"
$@ && exit $?
done
exit $?
-11
View File
@@ -1,11 +0,0 @@
#!/bin/bash
set -x
set -e
python -mtests
if [[ "$TRAVIS_PULL_REQUEST" == "false" && "$TRAVIS_SECURE_ENV_VARS" == "true" ]]; then
pip install codecov
codecov
fi