Skip to content

Commit

Permalink
Merge pull request #27 from utopia-php/refactor-pipelines
Browse files Browse the repository at this point in the history
Refactor pipelines
  • Loading branch information
abnegate authored Oct 20, 2023
2 parents 01bf0d2 + 20eba25 commit 4593d4d
Show file tree
Hide file tree
Showing 15 changed files with 1,025 additions and 3,040 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: "CodeQL"

on: [ pull_request ]
jobs:
lint:
name: CodeQL
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 2

- run: git checkout HEAD^2

- name: Run CodeQL
run: |
docker run --rm -v $PWD:/app composer sh -c \
"composer install --profile --ignore-platform-reqs && composer check"
43 changes: 43 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: "Tests"

on: [pull_request]
jobs:
tests:
name: Unit & E2E
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 2
submodules: recursive

- run: git checkout HEAD^2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build image
uses: docker/build-push-action@v3
with:
context: .
push: false
tags: database-dev
load: true
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Start Containers
run: |
docker compose up -d
sleep 10
- name: Run Tests
run: |
arch=$(uname -m)
if [ "${arch}" = "amd64" ]; then
docker compose exec tests vendor/bin/phpunit --configuration phpunit.xml --testsuite X86;
elif [ "${arch}" = "arm64" ] || [ "${arch}" = "aarch64" ]; then
docker compose exec tests vendor/bin/phpunit --configuration phpunit.xml --testsuite ARM64;
fi
26 changes: 0 additions & 26 deletions .travis.yml

This file was deleted.

23 changes: 15 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,26 @@
}
],
"autoload": {
"psr-4": {"Utopia\\System\\": "src/System"}
"psr-4": {
"Utopia\\System\\": "src/System"
}
},
"scripts": {
"lint": "./vendor/bin/pint --test",
"format": "./vendor/bin/pint"
"lint": "./vendor/bin/pint --test",
"format": "./vendor/bin/pint",
"check": "./vendor/bin/phpstan analyse --level=max --memory-limit=1G src tests"
},
"require": {
"php": ">=8.0.0",
"laravel/pint": "1.2.*"
"php": ">=8.0.0"
},
"require-dev": {
"phpunit/phpunit": "^9.3",
"vimeo/psalm": "4.0.1",
"squizlabs/php_codesniffer": "^3.6"
"phpunit/phpunit": "9.6.*",
"laravel/pint": "1.13.*",
"phpstan/phpstan": "1.10.*"
},
"config": {
"platform": {
"php": "8.0"
}
}
}
Loading

0 comments on commit 4593d4d

Please sign in to comment.