Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor pipelines #27

Merged
merged 12 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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