2020-01-22 23:52:49 +00:00
|
|
|
name: Build, Test and Publish
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
schedule:
|
|
|
|
- cron: '0 2 * * 0' # Weekly on Sundays at 02:00
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
publish:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@master
|
2020-01-31 06:55:24 +00:00
|
|
|
- name: Reduce Git repository size.
|
|
|
|
run: |
|
|
|
|
git gc --prune=now --aggressive
|
2020-01-22 23:52:49 +00:00
|
|
|
- name: Publish to Docker Hub
|
|
|
|
uses: elgohr/Publish-Docker-Github-Action@master
|
2020-01-24 22:50:29 +00:00
|
|
|
if: github.event_name == 'push'
|
2020-01-22 23:52:49 +00:00
|
|
|
with:
|
|
|
|
name: azuracast/azuracast_web_v2
|
|
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
2020-03-14 04:12:08 +00:00
|
|
|
tag_names: true
|
2020-01-22 23:52:49 +00:00
|
|
|
cache: ${{ github.event_name != 'schedule' }}
|
|
|
|
test:
|
|
|
|
needs: [publish]
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@master
|
|
|
|
with:
|
|
|
|
fetch-depth: 1
|
|
|
|
- name: Set up test environment
|
|
|
|
run: |
|
|
|
|
cp azuracast.sample.env azuracast.env
|
|
|
|
cp docker-compose.sample.yml docker-compose.yml
|
|
|
|
cp docker-compose.testing.yml docker-compose.override.yml
|
|
|
|
chmod 777 tests/_output/
|
|
|
|
docker-compose build web
|
|
|
|
docker-compose run --user="azuracast" --rm web azuracast_install
|
|
|
|
- name: Run test suite
|
|
|
|
run: |
|
|
|
|
docker-compose run --user="azuracast" --rm web composer test
|
|
|
|
- name: Echo test output directory
|
|
|
|
if: failure()
|
|
|
|
run: |
|
2020-05-02 08:15:46 +00:00
|
|
|
cat tests/_output/*
|