Improve GH action build time

Tests are redundant because right now it's just making sure the image can build. But if the image _can't_ build, it'll fail the second time around as well, making the first "test" redundant.
This commit is contained in:
R. Miles McCain 2020-04-14 13:47:41 -04:00 committed by GitHub
parent 086e13cbaf
commit cc22b4bdf9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,29 +18,9 @@ env:
IMAGE_NAME: shynet
jobs:
# Run tests.
# See also https://docs.docker.com/docker-hub/builds/automated-testing/
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run tests
run: |
if [ -f docker-compose.test.yml ]; then
docker-compose --file docker-compose.test.yml build
docker-compose --file docker-compose.test.yml run sut
else
docker build . --file Dockerfile
fi
# Push image to GitHub Packages.
# See also https://docs.docker.com/docker-hub/builds/
push:
# Ensure test job passes before pushing image.
needs: test
runs-on: ubuntu-latest
if: github.event_name == 'push'