mirror of
https://github.com/starship/starship
synced 2024-09-05 15:54:20 +00:00
Use starship-test docker image for running integration tests (#70)
* Publish docker image used in testing * Update integration_test to pull the image and build, using the image as its cache * Publish the built image after successful test runs on master
This commit is contained in:
parent
5b1c2107db
commit
617b278a33
|
@ -17,9 +17,7 @@ jobs:
|
||||||
displayName: Check starship with nightly
|
displayName: Check starship with nightly
|
||||||
|
|
||||||
# Run the integration tests in a Docker container
|
# Run the integration tests in a Docker container
|
||||||
- job: test_docker
|
- template: ci/azure-test-docker.yml
|
||||||
displayName: Test starship Docker
|
parameters:
|
||||||
pool:
|
name: test_docker
|
||||||
vmImage: ubuntu-16.04
|
displayName: Test starship Docker
|
||||||
steps:
|
|
||||||
- script: ./integration_test
|
|
||||||
|
|
16
ci/azure-test-docker.yml
Normal file
16
ci/azure-test-docker.yml
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
jobs:
|
||||||
|
- job: ${{ parameters.name }}
|
||||||
|
displayName: ${{ parameters.displayName }}
|
||||||
|
pool:
|
||||||
|
vmImage: ubuntu-16.04
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- script: ./integration_test
|
||||||
|
displayName: Run integration test within Docker
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
docker login -u $(dockerUsername) -p $(dockerPassword)
|
||||||
|
docker push starshipcommand/starship-test
|
||||||
|
# Only push new image if on master and build is passing
|
||||||
|
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
|
||||||
|
displayName: Push image to dockerhub
|
|
@ -6,8 +6,14 @@ if ! (docker --version); then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
printf 'Pulling latest docker image'
|
||||||
|
docker pull starshipcommand/starship-test
|
||||||
|
|
||||||
printf 'Building test docker image:\n'
|
printf 'Building test docker image:\n'
|
||||||
docker build -f tests/Dockerfile --tag starship-test .
|
docker build -f tests/Dockerfile \
|
||||||
|
--tag starshipcommand/starship-test \
|
||||||
|
--cache-from starshipcommand/starship-test \
|
||||||
|
.
|
||||||
|
|
||||||
printf 'Running test suite:\n'
|
printf 'Running test suite:\n'
|
||||||
docker run --rm -t -v $(pwd):/starship starship-test
|
docker run --rm -t -v $(pwd):/starship starshipcommand/starship-test
|
||||||
|
|
Loading…
Reference in a new issue