feat(ci): add GitHub Actions workflow for testing and Docker builds #17
+30
-15
@@ -7,7 +7,7 @@ on:
|
|||||||
branches: [main]
|
branches: [main]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
build-dev:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -22,18 +22,19 @@ jobs:
|
|||||||
context: .
|
context: .
|
||||||
file: Dockerfile.dev
|
file: Dockerfile.dev
|
||||||
target: dev
|
target: dev
|
||||||
load: true
|
outputs: type=docker,dest=/tmp/graph-dev.tar
|
||||||
tags: graph-dev:ci
|
tags: graph-dev:ci
|
||||||
cache-from: type=gha
|
cache-from: type=gha
|
||||||
cache-to: type=gha,mode=max
|
cache-to: type=gha,mode=max
|
||||||
|
|
||||||
- name: Run PHPUnit
|
- name: Upload dev image
|
||||||
run: docker run --rm graph-dev:ci vendor/bin/phpunit --testdox
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
- name: Run PHPStan
|
name: graph-dev-image
|
||||||
run: docker run --rm graph-dev:ci composer phpstan
|
path: /tmp/graph-dev.tar
|
||||||
|
retention-days: 1
|
||||||
docker-build:
|
build-prod:
|
||||||
|
needs: build-dev
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -50,10 +51,24 @@ jobs:
|
|||||||
target: final
|
target: final
|
||||||
push: false
|
push: false
|
||||||
|
|
||||||
- name: Build dev image (dev target)
|
test:
|
||||||
uses: docker/build-push-action@v5
|
needs: build-dev
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Download dev image
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
context: .
|
name: graph-dev-image
|
||||||
file: Dockerfile.dev
|
path: /tmp
|
||||||
target: dev
|
|
||||||
push: false
|
- name: Load dev image
|
||||||
|
run: docker load --input /tmp/graph-dev.tar
|
||||||
|
|
||||||
|
- name: Run PHPUnit
|
||||||
|
run: docker run --rm graph-dev:ci vendor/bin/phpunit --testdox
|
||||||
|
|
||||||
|
- name: Run PHPStan
|
||||||
|
run: docker run --rm graph-dev:ci composer phpstan
|
||||||
|
|||||||
Reference in New Issue
Block a user