You've already forked Php-Template
All checks were successful
🧪✨ Tests Workflow / 🛡️ 🔒 Library Audit (push) Successful in 1m55s
🧪✨ Tests Workflow / 🧪 ✅ Unit Tests (push) Successful in 1m56s
🧪✨ Tests Workflow / 📝 ✨ Code Lint (push) Successful in 2m4s
🧪✨ Tests Workflow / 🧪 ✨ Database Migrations (push) Successful in 2m48s
🧪✨ Tests Workflow / 🛡️ 🔒 License Check (push) Successful in 3m2s
🧪✨ Tests Workflow / 🐙 🔍 Code Sniffer (push) Successful in 3m5s
257 lines
8.5 KiB
YAML
257 lines
8.5 KiB
YAML
on:
|
|
push:
|
|
branches:
|
|
- "*"
|
|
|
|
name: 🧪✨ Tests Workflow
|
|
|
|
jobs:
|
|
|
|
DatabaseMigrations:
|
|
name: 🧪 ✨ Database Migrations
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
|
|
- name: 🛡️ 🔒 Add Siteworx CA Certificates
|
|
run: |
|
|
apt update && apt install -yq ca-certificates curl
|
|
curl -Ls https://siteworxpro.com/hosted/Siteworx+Root+CA.pem -o /usr/local/share/ca-certificates/sw.crt
|
|
update-ca-certificates
|
|
|
|
- name: 📖 🔍 Checkout Repository Code
|
|
uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 1
|
|
|
|
- name: 🔑 🔐 Login to Docker Hub
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: 🏎️ 🏁 Start Support Containers
|
|
run: |
|
|
echo "Starting Support Containers"
|
|
docker run --rm \
|
|
--network "${{ env.JOB_CONTAINER_NAME }}-${{ gitea.job }}-network" \
|
|
--name ${{ gitea.job }}-${{ gitea.run_id }}-postgres \
|
|
-e POSTGRES_USER=postgres \
|
|
-e POSTGRES_PASSWORD=postgres \
|
|
-e POSTGRES_DB=postgres \
|
|
-p 5432 \
|
|
-d postgres:17
|
|
|
|
echo "Waiting for Postgres to start"
|
|
sleep 10
|
|
|
|
- name: 💽 ⬆️ Run Migrations
|
|
run: |
|
|
docker run \
|
|
--name ${{ gitea.run_id }}-migrate \
|
|
--rm \
|
|
--volumes-from ${{ env.JOB_CONTAINER_NAME }} \
|
|
--network "${{ env.JOB_CONTAINER_NAME }}-${{ gitea.job }}-network" \
|
|
-w ${{ github.workspace }} \
|
|
siteworxpro/migrate:v4.18.3 -database "postgres://postgres:postgres@${{ gitea.job }}-${{ gitea.run_id }}-postgres:5432/postgres?sslmode=disable" -path db/migrations up
|
|
|
|
- name: 💽 ⬇️ Rollback Migrations
|
|
run: |
|
|
docker run \
|
|
--name ${{ gitea.run_id }}-migrate \
|
|
--rm \
|
|
--volumes-from ${{ env.JOB_CONTAINER_NAME }} \
|
|
--network "${{ env.JOB_CONTAINER_NAME }}-${{ gitea.job }}-network" \
|
|
-w ${{ github.workspace }} \
|
|
siteworxpro/migrate:v4.18.3 -database "postgres://postgres:postgres@${{ gitea.job }}-${{ gitea.run_id }}-postgres:5432/postgres?sslmode=disable" -path db/migrations down --all
|
|
|
|
- name: 🧨 💥 Tear Down Support Containers
|
|
if: always()
|
|
run: |
|
|
docker stop ${{ gitea.job }}-${{ gitea.run_id }}-postgres
|
|
|
|
LibraryAudit:
|
|
name: 🛡️ 🔒 Library Audit
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: 🛡️ 🔒 Add Siteworx CA Certificates
|
|
run: |
|
|
apt update && apt install -yq ca-certificates curl
|
|
curl -Ls https://siteworxpro.com/hosted/Siteworx+Root+CA.pem -o /usr/local/share/ca-certificates/sw.crt
|
|
update-ca-certificates
|
|
|
|
- name: 📖 🔍 Checkout Repository Code
|
|
uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 1
|
|
|
|
- name: 🔑 🔐 Login to Docker Hub
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: 📖 ✨ Install Composer Libraries
|
|
run: |
|
|
docker run --rm \
|
|
--volumes-from ${{ env.JOB_CONTAINER_NAME }} \
|
|
-w ${{ github.workspace }} \
|
|
siteworxpro/composer \
|
|
install --ignore-platform-reqs --no-interaction --prefer-dist --optimize-autoloader
|
|
|
|
- name: Run Library Audit
|
|
run: |
|
|
docker run --rm \
|
|
--volumes-from ${{ env.JOB_CONTAINER_NAME }} \
|
|
-w ${{ github.workspace }} \
|
|
siteworxpro/composer \
|
|
audit
|
|
|
|
LicenseCheck:
|
|
name: 🛡️ 🔒 License Check
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
|
|
- name: 🛡️ 🔒 Add Siteworx CA Certificates
|
|
run: |
|
|
apt update && apt install -yq ca-certificates curl
|
|
curl -Ls https://siteworxpro.com/hosted/Siteworx+Root+CA.pem -o /usr/local/share/ca-certificates/sw.crt
|
|
update-ca-certificates
|
|
|
|
- name: 📖 🔍 Checkout Repository Code
|
|
uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 1
|
|
|
|
- name: 🔑 🔐 Login to Docker Hub
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: 📖 ✨ Install Composer Libraries
|
|
run: |
|
|
docker run --rm \
|
|
--volumes-from ${{ env.JOB_CONTAINER_NAME }} \
|
|
-w ${{ github.workspace }} \
|
|
siteworxpro/composer \
|
|
install --ignore-platform-reqs --no-interaction --prefer-dist --optimize-autoloader
|
|
|
|
- name: 🎟️ 🔬 Run License Check
|
|
run: |
|
|
docker run --rm \
|
|
--volumes-from ${{ env.JOB_CONTAINER_NAME }} \
|
|
-w ${{ github.workspace }} \
|
|
siteworxpro/composer \
|
|
run tests:license
|
|
|
|
CodeLint:
|
|
name: 📝 ✨ Code Lint
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: 🛡️ 🔒 Add Siteworx CA Certificates
|
|
run: |
|
|
apt update && apt install -yq ca-certificates curl
|
|
curl -Ls https://siteworxpro.com/hosted/Siteworx+Root+CA.pem -o /usr/local/share/ca-certificates/sw.crt
|
|
update-ca-certificates
|
|
|
|
- name: 📖 🔍 Checkout Repository Code
|
|
uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 1
|
|
|
|
- name: 🔑 🔐 Login to Docker Hub
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: 📖 ✨ Install Composer Libraries
|
|
run: |
|
|
docker run --rm \
|
|
--volumes-from ${{ env.JOB_CONTAINER_NAME }} \
|
|
-w ${{ github.workspace }} \
|
|
siteworxpro/composer \
|
|
install --ignore-platform-reqs --no-interaction --prefer-dist --optimize-autoloader
|
|
|
|
- name: Run Code Lint
|
|
run: |
|
|
docker run --rm \
|
|
--volumes-from ${{ env.JOB_CONTAINER_NAME }} \
|
|
-w ${{ github.workspace }} \
|
|
siteworxpro/composer \
|
|
run tests:lint
|
|
|
|
CodeSniffer:
|
|
name: 🐙 🔍 Code Sniffer
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: 🛡️ 🔒 Add Siteworx CA Certificates
|
|
run: |
|
|
apt update && apt install -yq ca-certificates curl
|
|
curl -Ls https://siteworxpro.com/hosted/Siteworx+Root+CA.pem -o /usr/local/share/ca-certificates/sw.crt
|
|
update-ca-certificates
|
|
|
|
- name: 📖 🔍 Checkout Repository Code
|
|
uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 1
|
|
|
|
- name: 🔑 🔐 Login to Docker Hub
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: Install Composer Libraries
|
|
run: |
|
|
docker run --rm \
|
|
--volumes-from ${{ env.JOB_CONTAINER_NAME }} \
|
|
-w ${{ github.workspace }} \
|
|
siteworxpro/composer \
|
|
install --ignore-platform-reqs --no-interaction --prefer-dist --optimize-autoloader
|
|
|
|
- name: Run Code Sniffer
|
|
run: |
|
|
docker run --rm \
|
|
--volumes-from ${{ env.JOB_CONTAINER_NAME }} \
|
|
-w ${{ github.workspace }} \
|
|
siteworxpro/composer \
|
|
run tests:phpstan
|
|
|
|
UnitTests:
|
|
name: 🧪 ✅ Unit Tests
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: 🛡️ 🔒 Add Siteworx CA Certificates
|
|
run: |
|
|
apt update && apt install -yq ca-certificates curl
|
|
curl -Ls https://siteworxpro.com/hosted/Siteworx+Root+CA.pem -o /usr/local/share/ca-certificates/sw.crt
|
|
update-ca-certificates
|
|
|
|
- name: 📖 🔍 Checkout Repository Code
|
|
uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 1
|
|
|
|
- name: 🔑 🔐 Login to Docker Hub
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: Install Composer Libraries
|
|
run: |
|
|
docker run --rm \
|
|
--volumes-from ${{ env.JOB_CONTAINER_NAME }} \
|
|
-w ${{ github.workspace }} \
|
|
siteworxpro/composer \
|
|
install --ignore-platform-reqs --no-interaction --prefer-dist --optimize-autoloader
|
|
|
|
- name: Run Unit Tests
|
|
run: |
|
|
docker run --rm \
|
|
--volumes-from ${{ env.JOB_CONTAINER_NAME }} \
|
|
-w ${{ github.workspace }} \
|
|
siteworxpro/composer \
|
|
run tests:unit
|