Skip to content

Fixed README

Fixed README #39

Workflow file for this run

name: CI
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "master" branch
push:
branches:
- "master"
- "development"
pull_request:
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
setup:
runs-on: ubuntu-latest
steps:
- name: Output branch
run: echo $BRANCH_NAME
- name: Setting environment
id: tag
run: |
if [[ $BRANCH_NAME == 'master' ]]; then
echo "TAG=latest" >> $GITHUB_OUTPUT
else
echo "TAG=$BRANCH_NAME" >> $GITHUB_OUTPUT
fi
outputs:
tag: ${{ steps.tag.outputs.TAG }}
build-composer:
needs: setup
runs-on: ubuntu-latest
container:
image: composer:2.7.2
steps:
- uses: actions/checkout@v4
- name: Run composer
run: composer install --ignore-platform-reqs
- name: Artifacts
uses: actions/upload-artifact@v4
with:
name: composer-vendor
path: vendor
retention-days: 5
build:
needs:
- setup
- build-composer
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Download vendor folder
uses: actions/download-artifact@v4
with:
name: composer-vendor
path: vendor/
- name: Build the Docker image
run: docker buildx build --pull --push --no-cache --tag="ghcr.io/faimmedia/php-migration/test:${{ needs.setup.outputs.tag }}" --file ./docker/php/Dockerfile .
test:
needs:
- setup
- build
runs-on: ubuntu-latest
container:
image: ghcr.io/faimmedia/php-migration/test:${{ needs.setup.outputs.tag }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
services:
postgres:
image: postgres:16-alpine3.19
env:
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_USER: migrate-test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Set executable
run: chmod +x /app/vendor/bin/phpunit
- name: Run tests
run: /app/vendor/bin/phpunit -c /app/test/phpunit.xml