Skip to content

Additional integration tests #90

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

Merged
merged 14 commits into from
Jun 29, 2022
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
2 changes: 1 addition & 1 deletion .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
id: matrix_generation
env:
PROJECT_NAME_TO_TEST: ${{ matrix.projectName }}
run: cd tests/${PROJECT_NAME_TO_TEST} && docker run -v $(realpath .):/github/workspace -w=/github/workspace ${TEST_TAG} node ../../index.js $(test -r diff && cat diff || echo -n "")
run: cd tests/${PROJECT_NAME_TO_TEST} && docker run -i --entrypoint /action/index.js -v $(realpath .):/github/workspace -w=/github/workspace ${TEST_TAG} $(test -r diff && cat diff || echo -n "")

- name: "Output generated matrix"
uses: sergeysova/jq-action@v2
Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ RUN apk update \

RUN mkdir /action
ADD index.js /action/index.js
RUN chmod u+x /action/index.js
ADD src /action/src
ADD package.json /action/package.json
ADD package-lock.json /action/package-lock.json
Expand Down
3 changes: 1 addition & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,9 @@ if [[ "$GITHUB_EVENT_NAME" == "pull_request" ]];then
DIFF=$(git diff --name-only $GITHUB_BASE_REF...HEAD)
fi

REQUIRE_CHECKS=true
if [[ "$DIFF" != "" ]];then
echo "Found changes in the following files:"
echo ${DIFF}
fi

node /action/index.js ${DIFF}
/action/index.js ${DIFF}
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env node
import core from "@actions/core";
import fs from "fs";
import checkRequirements from "./src/check-requirements.js";
Expand Down
1 change: 1 addition & 0 deletions tests/code-check-codeception-dist/codeception.yml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
1 change: 1 addition & 0 deletions tests/code-check-codeception-nodist/codeception.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
17 changes: 17 additions & 0 deletions tests/code-check-exclusion-via-config/.laminas-ci.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"stablePHP": "7.4",
"exclude": [
{
"name": "./vendor/bin/codecept run on PHP 7.4"
},
{
"name": "PHPUnit on PHP 7.4 with lowest dependencies"
},
{
"name": "PHPUnit on PHP 7.4 with locked dependencies"
},
{
"name": "PHPUnit on PHP 7.4 with latest dependencies"
}
]
}
1 change: 1 addition & 0 deletions tests/code-check-exclusion-via-config/codeception.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
10 changes: 10 additions & 0 deletions tests/code-check-exclusion-via-config/matrix.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"include": [
{
"name": "No checks",
"job": "{\"command\":\"\",\"php\":\"7.4\",\"extensions\":[],\"ini\":[],\"dependencies\":\"locked\",\"ignore_platform_reqs_8\":false,\"ignore_php_platform_requirement\":false,\"additional_composer_arguments\":[]}",
"operatingSystem": "ubuntu-latest",
"action": "laminas/laminas-continuous-integration-action@v1"
}
]
}
2 changes: 2 additions & 0 deletions tests/code-check-exclusion-via-config/phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8" ?>
<dummy/>
1 change: 1 addition & 0 deletions tests/code-check-infection-dist/infection.json.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
1 change: 1 addition & 0 deletions tests/code-check-infection-nodist/infection.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
3 changes: 3 additions & 0 deletions tests/code-check-locked-dependencies/.laminas-ci.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"stablePHP": "7.4"
}
1 change: 1 addition & 0 deletions tests/code-check-locked-dependencies/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
1 change: 1 addition & 0 deletions tests/code-check-locked-dependencies/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions tests/code-check-locked-dependencies/infection.json.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
10 changes: 10 additions & 0 deletions tests/code-check-locked-dependencies/matrix.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"include": [
{
"name": "phpdbg -qrr ./vendor/bin/infection on PHP 7.4",
"job": "{\"command\":\"phpdbg -qrr ./vendor/bin/infection\",\"php\":\"7.4\",\"extensions\":[],\"ini\":[\"memory_limit = -1\"],\"dependencies\":\"locked\",\"ignore_platform_reqs_8\":false,\"ignore_php_platform_requirement\":false,\"additional_composer_arguments\":[]}",
"operatingSystem": "ubuntu-latest",
"action": "laminas/laminas-continuous-integration-action@v1"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"stablePHP": "7.4"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"require": {
"php": "~8.1.0"
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.laminas-ci.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"include": [
{
"name": "PHPUnit on PHP 8.1 with locked dependencies",
"job": "{\"command\":\"./vendor/bin/phpunit\",\"php\":\"8.1\",\"extensions\":[],\"ini\":[\"memory_limit = -1\"],\"dependencies\":\"locked\",\"ignore_platform_reqs_8\":false,\"ignore_php_platform_requirement\":false,\"additional_composer_arguments\":[]}",
"operatingSystem": "ubuntu-latest",
"action": "laminas/laminas-continuous-integration-action@v1"
},
{
"name": "PHPUnit on PHP 8.1 with lowest dependencies",
"job": "{\"command\":\"./vendor/bin/phpunit\",\"php\":\"8.1\",\"extensions\":[],\"ini\":[\"memory_limit = -1\"],\"dependencies\":\"lowest\",\"ignore_platform_reqs_8\":false,\"ignore_php_platform_requirement\":false,\"additional_composer_arguments\":[]}",
"operatingSystem": "ubuntu-latest",
"action": "laminas/laminas-continuous-integration-action@v1"
},
{
"name": "PHPUnit on PHP 8.1 with latest dependencies",
"job": "{\"command\":\"./vendor/bin/phpunit\",\"php\":\"8.1\",\"extensions\":[],\"ini\":[\"memory_limit = -1\"],\"dependencies\":\"latest\",\"ignore_platform_reqs_8\":false,\"ignore_php_platform_requirement\":false,\"additional_composer_arguments\":[]}",
"operatingSystem": "ubuntu-latest",
"action": "laminas/laminas-continuous-integration-action@v1"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8" ?>
<dummy/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"stablePHP": "7.4"
}
5 changes: 5 additions & 0 deletions tests/code-checks-without-linting-due-to-diff/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"require": {
"php": "~8.1.0"
}
}
2 changes: 2 additions & 0 deletions tests/code-checks-without-linting-due-to-diff/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions tests/code-checks-without-linting-due-to-diff/diff
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
foo.php
Empty file.
22 changes: 22 additions & 0 deletions tests/code-checks-without-linting-due-to-diff/matrix.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"include": [
{
"name": "PHPUnit on PHP 8.1 with locked dependencies",
"job": "{\"command\":\"./vendor/bin/phpunit\",\"php\":\"8.1\",\"extensions\":[],\"ini\":[\"memory_limit = -1\"],\"dependencies\":\"locked\",\"ignore_platform_reqs_8\":false,\"ignore_php_platform_requirement\":false,\"additional_composer_arguments\":[]}",
"operatingSystem": "ubuntu-latest",
"action": "laminas/laminas-continuous-integration-action@v1"
},
{
"name": "PHPUnit on PHP 8.1 with lowest dependencies",
"job": "{\"command\":\"./vendor/bin/phpunit\",\"php\":\"8.1\",\"extensions\":[],\"ini\":[\"memory_limit = -1\"],\"dependencies\":\"lowest\",\"ignore_platform_reqs_8\":false,\"ignore_php_platform_requirement\":false,\"additional_composer_arguments\":[]}",
"operatingSystem": "ubuntu-latest",
"action": "laminas/laminas-continuous-integration-action@v1"
},
{
"name": "PHPUnit on PHP 8.1 with latest dependencies",
"job": "{\"command\":\"./vendor/bin/phpunit\",\"php\":\"8.1\",\"extensions\":[],\"ini\":[\"memory_limit = -1\"],\"dependencies\":\"latest\",\"ignore_platform_reqs_8\":false,\"ignore_php_platform_requirement\":false,\"additional_composer_arguments\":[]}",
"operatingSystem": "ubuntu-latest",
"action": "laminas/laminas-continuous-integration-action@v1"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8" ?>
<dummy/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{
}
5 changes: 5 additions & 0 deletions tests/doc-linting-without-code-checks-due-diff/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"require": {
"php": "~8.1.0"
}
}
2 changes: 2 additions & 0 deletions tests/doc-linting-without-code-checks-due-diff/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions tests/doc-linting-without-code-checks-due-diff/diff
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docs/book/main.md
Empty file.
10 changes: 10 additions & 0 deletions tests/doc-linting-without-code-checks-due-diff/matrix.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"include": [
{
"name": "markdownlint docs/book/**/*.md on PHP 8.1",
"job": "{\"command\":\"markdownlint docs/book/**/*.md\",\"php\":\"8.1\",\"extensions\":[],\"ini\":[\"memory_limit = -1\"],\"dependencies\":\"locked\",\"ignore_platform_reqs_8\":false,\"ignore_php_platform_requirement\":false,\"additional_composer_arguments\":[]}",
"operatingSystem": "ubuntu-latest",
"action": "laminas/laminas-continuous-integration-action@v1"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8" ?>
<dummy/>
3 changes: 3 additions & 0 deletions tests/no-checks-due-to-diff/.laminas-ci.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"stablePHP": "7.4"
}
5 changes: 5 additions & 0 deletions tests/no-checks-due-to-diff/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"require": {
"php": "~8.1.0"
}
}
2 changes: 2 additions & 0 deletions tests/no-checks-due-to-diff/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions tests/no-checks-due-to-diff/diff
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
whatever.json
10 changes: 10 additions & 0 deletions tests/no-checks-due-to-diff/matrix.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"include": [
{
"name": "No checks",
"job": "{\"command\":\"\",\"php\":\"7.4\",\"extensions\":[],\"ini\":[],\"dependencies\":\"locked\",\"ignore_platform_reqs_8\":false,\"ignore_php_platform_requirement\":false,\"additional_composer_arguments\":[]}",
"operatingSystem": "ubuntu-latest",
"action": "laminas/laminas-continuous-integration-action@v1"
}
]
}
2 changes: 2 additions & 0 deletions tests/no-checks-due-to-diff/phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8" ?>
<dummy/>