|
| 1 | +name: Test video files |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - trunk |
| 7 | + pull_request: |
| 8 | + branches: |
| 9 | + - trunk |
| 10 | + |
| 11 | +jobs: |
| 12 | + build-and-test: |
| 13 | + # Skip job based on the commit message, only works in push to branches for now |
| 14 | + if: contains(toJson(github.event.commits), '[skip ci]') == false |
| 15 | + name: Test video recorded through Docker Selenium |
| 16 | + runs-on: ubuntu-18.04 |
| 17 | + strategy: |
| 18 | + matrix: |
| 19 | + use-random-user: [false, true] |
| 20 | + steps: |
| 21 | + - uses: actions/checkout@v1 |
| 22 | + - name: Output Docker info |
| 23 | + run: docker info |
| 24 | + - name: Set up Python 3.8 |
| 25 | + uses: actions/setup-python@v2 |
| 26 | + with: |
| 27 | + python-version: 3.8 |
| 28 | + - name: Get branch name (only for push to branch) |
| 29 | + if: github.event_name == 'push' |
| 30 | + run: echo "::set-env name=BRANCH::$(echo ${PUSH_BRANCH##*/})" |
| 31 | + env: |
| 32 | + PUSH_BRANCH: ${{ github.ref }} |
| 33 | + - name: Get target branch name (only for PRs) |
| 34 | + if: github.event_name == 'pull_request' |
| 35 | + run: echo "::set-env name=BRANCH::$(echo ${TARGET_BRANCH##*/})" |
| 36 | + env: |
| 37 | + TARGET_BRANCH: ${{ github.head_ref }} |
| 38 | + - name: Output branch name |
| 39 | + run: echo ${BRANCH} |
| 40 | + - name: Sets build date |
| 41 | + run: echo ::set-env name=BUILD_DATE::$(date '+%Y%m%d') |
| 42 | + - name: Run Docker Compose to record video |
| 43 | + run: USE_RANDOM_USER_ID=${USE_RANDOM_USER} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make test_video |
| 44 | + env: |
| 45 | + USE_RANDOM_USER: ${{ matrix.use-random-user }} |
| 46 | + - name: Upload recorded Chrome video |
| 47 | + uses: actions/upload-artifact@v2 |
| 48 | + with: |
| 49 | + name: chrome_video |
| 50 | + path: ./tests/videos/chrome_video.mp4 |
| 51 | + - name: Upload recorded Firefox video |
| 52 | + uses: actions/upload-artifact@v2 |
| 53 | + with: |
| 54 | + name: firefox_video |
| 55 | + path: ./tests/videos/firefox_video.mp4 |
| 56 | + - name: Upload recorded Opera video |
| 57 | + uses: actions/upload-artifact@v2 |
| 58 | + with: |
| 59 | + name: opera_video |
| 60 | + path: ./tests/videos/opera_video.mp4 |
0 commit comments