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

GH Actions: re-work the integration tests #221

Merged
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
145 changes: 132 additions & 13 deletions .github/workflows/continuous-integration.yml
Expand Up @@ -108,17 +108,10 @@ jobs:
composer-version:
- "v1"
- "v2"
composer-options:
- "--ignore-platform-reqs"
- ""
working-directory:
- "tests/fixtures/with-lock-file"
- ""
ignore-cache:
- "yes"
- ""
custom-cache-key:
- "my-super-custom-cache-key"
- "tests/fixtures/no-lock-file"
- "tests/fixtures/out-of-sync-lock"
- ""
steps:
- name: "Checkout repository"
Expand All @@ -129,11 +122,137 @@ jobs:
php-version: "latest"
tools: "composer:${{ matrix.composer-version }}"
coverage: "none"
- name: "Run composer-install action"

- name: "Test: plain install"
uses: ./
with:
working-directory: "${{ matrix.working-directory }}"
dependency-versions: "${{ matrix.dependency-versions }}"

- name: Clean up between tests
run: |
git clean -ffdx && git reset --hard HEAD
composer clear-cache

- name: "Test: ignore platform reqs"
uses: ./
with:
working-directory: "${{ matrix.working-directory }}"
dependency-versions: "${{ matrix.dependency-versions }}"
composer-options: '--ignore-platform-reqs'

- name: Clean up between tests
run: |
git clean -ffdx && git reset --hard HEAD
composer clear-cache

- name: "Test: ignore platform reqs, ignore cache"
uses: ./
with:
working-directory: "${{ matrix.working-directory }}"
dependency-versions: "${{ matrix.dependency-versions }}"
composer-options: '--ignore-platform-reqs'
ignore-cache: 'yes'

- name: Clean up between tests
run: |
git clean -ffdx && git reset --hard HEAD
composer clear-cache

- name: "Test: ignore platform reqs, custom cache key"
uses: ./
with:
working-directory: "${{ matrix.working-directory }}"
dependency-versions: "${{ matrix.dependency-versions }}"
composer-options: '--ignore-platform-reqs'
custom-cache-key: 'my-super-custom-cache-key'

- name: Clean up between tests
run: |
git clean -ffdx && git reset --hard HEAD
composer clear-cache

- name: "Test: ignore platform reqs, ignore cache, custom cache key"
uses: ./
with:
working-directory: "${{ matrix.working-directory }}"
dependency-versions: "${{ matrix.dependency-versions }}"
composer-options: '--ignore-platform-reqs'
ignore-cache: 'yes'
custom-cache-key: 'my-super-custom-cache-key'

- name: Clean up between tests
run: |
git clean -ffdx && git reset --hard HEAD
composer clear-cache

- name: "Test: ignore cache"
uses: ./
with:
working-directory: "${{ matrix.working-directory }}"
dependency-versions: "${{ matrix.dependency-versions }}"
ignore-cache: 'yes'

- name: Clean up between tests
run: |
git clean -ffdx && git reset --hard HEAD
composer clear-cache

- name: "Test: ignore cache, custom cache key"
uses: ./
with:
working-directory: "${{ matrix.working-directory }}"
dependency-versions: "${{ matrix.dependency-versions }}"
composer-options: "${{ matrix.composer-options }}"
ignore-cache: 'yes'
custom-cache-key: 'my-super-custom-cache-key'

- name: Clean up between tests
run: |
git clean -ffdx && git reset --hard HEAD
composer clear-cache

- name: "Test: custom cache key"
uses: ./
with:
working-directory: "${{ matrix.working-directory }}"
ignore-cache: "${{ matrix.ignore-cache }}"
custom-cache-key: "${{ matrix.custom-cache-key }}"
dependency-versions: "${{ matrix.dependency-versions }}"
custom-cache-key: 'my-super-custom-cache-key'

run-no-cleanup:
needs: test
name: "Run unclean"
runs-on: "${{ matrix.operating-system }}"
strategy:
matrix:
operating-system:
- "ubuntu-latest"
- "windows-latest"
composer-version:
- "v1"
- "v2"
steps:
- name: "Checkout repository"
uses: "actions/checkout@v2"
- name: "Set up PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "latest"
tools: "composer:${{ matrix.composer-version }}"
coverage: "none"

- name: "Test: plain install"
uses: ./
with:
working-directory: 'tests/fixtures/with-lock-file'

- name: "Test: switch to lowest dependencies"
uses: ./
with:
working-directory: 'tests/fixtures/with-lock-file'
dependency-versions: 'lowest'

- name: "Test: switch to highest dependencies"
uses: ./
with:
working-directory: 'tests/fixtures/with-lock-file'
dependency-versions: 'highest'
4 changes: 2 additions & 2 deletions composer.json
Expand Up @@ -9,8 +9,8 @@
"email": "ben@benramsey.com"
}
],
"require": {
"ehime/hello-world": "1.0.5"
"require-dev": {
"ehime/hello-world": "^1.0.0"
},
"config": {
"allow-plugins": false
Expand Down
6 changes: 3 additions & 3 deletions composer.lock

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

2 changes: 1 addition & 1 deletion tests/expect/composer.json
Expand Up @@ -10,7 +10,7 @@
}
],
"require": {
"ehime/hello-world": "1.0.5"
"ehime/hello-world": "^1.0.0"
},
"config": {
"allow-plugins": false
Expand Down
2 changes: 1 addition & 1 deletion tests/expect/composer.lock

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

2 changes: 1 addition & 1 deletion tests/fixtures/no-lock-file/composer.json
Expand Up @@ -10,7 +10,7 @@
}
],
"require": {
"ehime/hello-world": "1.0.5"
"ehime/hello-world": "^1.0.0"
},
"config": {
"allow-plugins": false
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/with-lock-file/composer.json
Expand Up @@ -10,7 +10,7 @@
}
],
"require": {
"ehime/hello-world": "1.0.5"
"ehime/hello-world": "^1.0.0"
},
"config": {
"allow-plugins": false
Expand Down
30 changes: 9 additions & 21 deletions tests/fixtures/with-lock-file/composer.lock

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