This repository was archived by the owner on Dec 18, 2024. It is now read-only.
Merge pull request #32 from 202ecommerce/dependabot/npm_and_yarn/view… #217
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Unit test | |
on: [push] | |
jobs: | |
# Run PHPUnit against the module and a PrestaShop release | |
phpunit: | |
name: PHPUnit | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
presta-versions: ['1.7.8.7'] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2.0.0 | |
# Add vendor folder in cache to make next builds faster | |
- name: Cache vendor folder | |
uses: actions/cache@v1 | |
with: | |
path: vendor | |
key: php-${{ hashFiles('composer.lock') }} | |
# Add composer local folder in cache to make next builds faster | |
- name: Cache composer folder | |
uses: actions/cache@v1 | |
with: | |
path: ~/.composer/cache | |
key: php-composer-cache | |
- run: composer update --ignore-platform-reqs | |
# Get Docker images 202ecommerce/prestashop | |
- name: Get PrestaShop 202 Image (Tag ${{ matrix.presta-versions }}) | |
run: docker run -tid --rm -v $PWD:/var/www/html/modules/axeptiocookies -e TEST_ID_CONFIGURATION=${{ secrets.TEST_ID_CONFIGURATION }} -e TEST_ID_PROJECT=${{ secrets.TEST_ID_PROJECT }} --name temp-unittest-ps 202ecommerce/prestashop:${{ matrix.presta-versions }} | |
# Clear previous instance of the module in the PrestaShop volume | |
- name: Install module and play unit test | |
run: docker exec -t temp-unittest-ps sh /var/www/html/modules/axeptiocookies/202/docker/run_for_unittest.sh | |
# Copy coverage report from container to local | |
- name: Copy coverage report from container to local | |
run: | | |
docker cp temp-unittest-ps:/var/www/html/modules/axeptiocookies/202/build/clover.xml $PWD | |
sed -i 's@'/var/www/html/modules/axeptiocookies/'@/github/workspace/@g' clover.xml | |
- name: SonarCloud Scan | |
uses: sonarsource/sonarcloud-github-action@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |