Continuous Integration #74
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Continuous Integration | |
"on": | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
schedule: | |
- cron: "0 0 * * MON" | |
permissions: | |
contents: read | |
env: | |
# Fix for symfony/color detection. We know GitHub Actions can handle it | |
ANSICON: 1 | |
CASTOR_CONTEXT: ci | |
jobs: | |
check-dockerfiles: | |
name: Check Dockerfile | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Check php/Dockerfile | |
uses: hadolint/[email protected] | |
with: | |
dockerfile: infrastructure/docker/services/php/Dockerfile | |
ci: | |
name: Continuous Integration | |
runs-on: ubuntu-latest | |
steps: | |
# Install official version of docker that correctly supports from-cache option in docker compose | |
- name: Set up Docker | |
uses: crazy-max/ghaction-setup-docker@v3 | |
with: | |
set-host: true | |
# Docker socket path is different when using setup docker | |
- name: Set Docker Socket Host | |
run: echo "DOCKER_SOCKET_PATH=${DOCKER_HOST:5}" >> $GITHUB_ENV | |
- name: Log in to registry | |
shell: bash | |
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin | |
- uses: actions/checkout@v4 | |
- name: setup-castor | |
uses: castor-php/[email protected] | |
- name: "Build and start the infrastructure" | |
run: "castor start" | |
- name: "Check PHP coding standards" | |
run: "castor qa:cs" | |
- name: "Run PHPStan" | |
run: "castor qa:phpstan" | |
- name: "Load fixtures" | |
run: "castor fixtures --env=test" | |
- name: "Run PHPUnit" | |
run: "castor qa:phpunit" |