Skip to content

Commit

Permalink
feat: enable tests on CI (#25)
Browse files Browse the repository at this point in the history
* feat: enable tests on CI before release

* feat: FTL-18486 run integration tests for pull requests

* feat: FTL-18486 cache testing env file
  • Loading branch information
maindotdev authored Dec 24, 2024
1 parent a4fadf6 commit 4041686
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,24 @@ jobs:
path: .
options: --exclude=vendor

- name: create empty .env file.
run: echo "" > tests/Helpers/.env
- name: Cache testing env file
uses: actions/cache@v4
id: testing-env-cache
with:
path: tests/Helpers/.env
key: ${{ runner.os }}-testing-env-${{ hashFiles('tests/Helpers/.env') }}

- if: ${{ steps.testing-env-cache.outputs.cache-hit != 'true' }}
name: Prepare environment file
env:
TESTING_ENV_FILE_CONTENT: ${{ secrets.TESTING_ENV_FILE_CONTENT }}
run: echo $TESTING_ENV_FILE_CONTENT | base64 --decode > tests/Helpers/.env

- uses: php-actions/phpstan@v3
with:
path: src/AuthProvider src/Common
level: 5
memory_limit: 2048m

- name: Integration tests
run: composer run-script test
16 changes: 16 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,22 @@ jobs:
path: .
options: --exclude=vendor

- name: Cache testing env file
uses: actions/cache@v4
id: testing-env-cache
with:
path: tests/Helpers/.env
key: ${{ runner.os }}-testing-env-${{ hashFiles('tests/Helpers/.env') }}

- if: ${{ steps.testing-env-cache.outputs.cache-hit != 'true' }}
name: Prepare environment file
env:
TESTING_ENV_FILE_CONTENT: ${{ secrets.TESTING_ENV_FILE_CONTENT }}
run: echo $TESTING_ENV_FILE_CONTENT | base64 --decode > tests/Helpers/.env

- name: Integration tests
run: composer run-script test

release:
environment: release
needs:
Expand Down

0 comments on commit 4041686

Please sign in to comment.