-
Notifications
You must be signed in to change notification settings - Fork 387
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate from Travis to GitHub Actions (#1218)
* Rename build and publish scripts to STRTA conventions * Create CI workflow * Remove Travis env file sourcing from cibuild * Move CI tests into cibuild script * Move codecov into cibuild * Stop running test containers with interactive TTY * Create test script * Add help documentation to cibuild * Enable pseudo TTY for Docker commands * Fix coverage configuration An upgrade for the coverage package was necessary, along with fixing some path references and volume mounts in the unit test container. * Use Codecov Action instead of script * Create release workflow to run cipublish * Remove check for pytorch image type, interpolate IMAGE_TYPE * Use Raster Vision Quay credentials for release * Remove Travis config * Run test script commands in Docker containers when on CI * Remove obsolete release instructions * Restrict Quay.io credentials to cipublish steps * Add help documentation to cipublish * Determine how to tag image in cipublish script * Use double quotes consistently for shell conditional clauses
- Loading branch information
1 parent
b32e889
commit 4eaa709
Showing
16 changed files
with
202 additions
and
141 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 |
---|---|---|
@@ -1,10 +1,7 @@ | ||
[run] | ||
source = | ||
rastervision/ | ||
rastervision | ||
omit = | ||
rastervision/protos/**.py | ||
rastervision/utils/filter_geojson.py | ||
rastervision/utils/geojson.py | ||
rastervision/utils/misc.py | ||
rastervision/data/vector_source/label_maker/**.py | ||
rastervision/data/label/tfod_utils/**.py | ||
*/rastervision_core/rastervision/core/data/vector_source/label_maker/*.py | ||
*/rastervision_core/rastervision/core/data/label/tfod_utils/*.py | ||
*/rastervision_core/rastervision/core/utils/*.py |
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,21 @@ | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
name: build | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
image_type: [pytorch] | ||
env: | ||
DOCKER_BUILDKIT: 1 | ||
IMAGE_TYPE: ${{ matrix.image_type }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- run: ./scripts/cibuild | ||
|
||
- uses: codecov/codecov-action@v2 |
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,34 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- "[0-9]+" # Major version only | ||
- "[0-9]+.[0-9]+" # Major and minor version | ||
- "[0-9]+.[0-9]+.[0-9]+" # Major, minor, and patch version | ||
tags: | ||
- "*" | ||
|
||
jobs: | ||
release: | ||
name: release | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
image_type: [pytorch] | ||
env: | ||
DOCKER_BUILDKIT: 1 | ||
IMAGE_TYPE: ${{ matrix.image_type }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- run: ./scripts/cibuild | ||
|
||
- uses: codecov/codecov-action@v2 | ||
|
||
- run: ./scripts/cipublish | ||
env: | ||
QUAY_USER: ${{ secrets.QUAY_RASTERVISION_USER }} | ||
QUAY_PASSWORD: ${{ secrets.QUAY_RASTERVISION_PASSWORD }} | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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
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
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,28 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
if [[ -n "${RASTER_VISION_DEBUG}" ]]; then | ||
set -x | ||
fi | ||
|
||
function usage() { | ||
echo -n \ | ||
"Usage: $(basename "$0") | ||
Build library for integration or a release. | ||
" | ||
} | ||
|
||
if [[ "${BASH_SOURCE[0]}" == "$0" ]]; then | ||
if [[ "${1:-}" == "--help" ]]; then | ||
usage | ||
else | ||
docker build \ | ||
--build-arg CUDA_VERSION="10.2" \ | ||
-t "raster-vision-${IMAGE_TYPE}" \ | ||
-f Dockerfile \ | ||
. | ||
|
||
./scripts/test | ||
fi | ||
fi |
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,50 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
if [[ -n "${RASTER_VISION_DEBUG}" ]]; then | ||
set -x | ||
fi | ||
|
||
function usage() { | ||
echo -n \ | ||
"Usage: $(basename "$0") | ||
Publish container images to Quay.io. | ||
" | ||
} | ||
|
||
if [[ -n "${GITHUB_SHA}" ]]; then | ||
GITHUB_SHA="${GITHUB_SHA:0:7}" | ||
else | ||
GITHUB_SHA="$(git rev-parse --short HEAD)" | ||
fi | ||
|
||
if [[ -z "${GITHUB_REF}" ]]; then | ||
# We don't know where GitHub sources the value of GITHUB_REF. git-describe | ||
# is close enough to be valid for publishing. | ||
GITHUB_REF="$(git describe --all)" | ||
fi | ||
|
||
if [[ "${BASH_SOURCE[0]}" == "$0" ]]; then | ||
if [[ "${1:-}" == "--help" ]]; then | ||
usage | ||
else | ||
docker login -u="${QUAY_USER}" -p="${QUAY_PASSWORD}" quay.io | ||
|
||
if [[ "${GITHUB_REF}" == "refs/heads/master" ]]; then | ||
# On master, use the current SHA and latest | ||
docker tag "raster-vision-${IMAGE_TYPE}" \ | ||
"quay.io/azavea/raster-vision:${IMAGE_TYPE}-${GITHUB_SHA}" | ||
docker push "quay.io/azavea/raster-vision:${IMAGE_TYPE}-${GITHUB_SHA}" | ||
|
||
docker tag "raster-vision-${IMAGE_TYPE}" \ | ||
"quay.io/azavea/raster-vision:${IMAGE_TYPE}-latest" | ||
docker push "quay.io/azavea/raster-vision:${IMAGE_TYPE}-latest" | ||
else | ||
# For everything else, use the branch or tag name | ||
docker tag "raster-vision-${IMAGE_TYPE}" \ | ||
"quay.io/azavea/raster-vision:${IMAGE_TYPE}-${GITHUB_REF##*/}" | ||
docker push "quay.io/azavea/raster-vision:${IMAGE_TYPE}-${GITHUB_REF##*/}" | ||
fi | ||
fi | ||
fi |
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,60 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
if [[ -n "${RASTER_VISION_DEBUG}" ]]; then | ||
set -x | ||
fi | ||
|
||
function usage() { | ||
echo -n \ | ||
"Usage: $(basename "$0") | ||
Run linters and tests. | ||
" | ||
} | ||
|
||
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then | ||
if [[ "${1:-}" == "--help" ]]; then | ||
usage | ||
else | ||
if [[ -n "${CI}" ]]; then | ||
# Execute test suites | ||
docker run \ | ||
--rm -t \ | ||
"raster-vision-${IMAGE_TYPE}" \ | ||
/opt/src/scripts/style_tests | ||
docker run \ | ||
-w "$(pwd)" \ | ||
-v "$(pwd):$(pwd)" \ | ||
--rm -t \ | ||
"raster-vision-${IMAGE_TYPE}" \ | ||
/opt/src/scripts/unit_tests | ||
docker run \ | ||
--rm -t \ | ||
"raster-vision-${IMAGE_TYPE}" \ | ||
/opt/src/scripts/integration_tests | ||
|
||
# Create new coverage reports | ||
docker run \ | ||
-w "$(pwd)" \ | ||
-v "$(pwd):$(pwd)" \ | ||
--rm -t \ | ||
"raster-vision-${IMAGE_TYPE}" \ | ||
coverage xml | ||
else | ||
# Local test suite runs against pytorch image by default | ||
IMAGE_TYPE=${IMAGE_TYPE:-pytorch} | ||
|
||
# Delete old coverage reports | ||
rm -f ./.coverage ./coverage.xml | ||
|
||
# Execute test suites | ||
./scripts/style_tests | ||
./scripts/unit_tests | ||
./scripts/integration_tests | ||
|
||
# Create new coverage reports | ||
coverage xml | ||
fi | ||
fi | ||
fi |