Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moving the testing from Travis to GHA #139

Merged
merged 1 commit into from
Sep 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,16 +1,44 @@
name: Docker multiarch publish
name: Docker test and multiarch build and publish

on: push
on: [push, pull_request]

env:
REPOSITORY: moodle-php-apache
DOCKERHUB_OWNER: moodlehq
GH_OWNER: moodlehq

jobs:
Build:
# Completely avoid forks to try this workflow.
if: github.repository_owner == 'moodlehq'
Test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Build image
run: |
docker build . -t moodle-php-apache

- name: Run tests
continue-on-error: true
run: |
docker run --name test0 -d -p 8000:80 -v $PWD/tests/fixtures:/var/www/html moodle-php-apache
docker exec test0 php /var/www/html/test.php
curl --fail http://127.0.0.1:8000/test.php

- name: Display container logs on failure
if: failure()
run: |
docker logs test0

- name: Cleanup docker images
run: |
docker rm -f test0

Publish:
# Completely avoid forks and pull requests to try this job.
if: github.repository_owner == 'moodlehq' && github.event_name == 'push'
# Requires Test to pass
needs: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down
12 changes: 0 additions & 12 deletions .travis.yml

This file was deleted.