This file contains 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: continuous-integration | |
on: | |
push: | |
branches: [ main ] | |
# FIXME: Enable pull request ci (currently disabled due to Magento Marketplace credentials) | |
# pull_request: | |
# branches: [ main ] | |
concurrency: | |
group: 'continuous-integration' | |
cancel-in-progress: false | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
MAGENTO_MARKETPLACE_USERNAME: ${{ secrets.MAGENTO_MARKETPLACE_USERNAME }} | |
MAGENTO_MARKETPLACE_PASSWORD: ${{ secrets.MAGENTO_MARKETPLACE_PASSWORD }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '19.x' | |
registry-url: 'https://registry.npmjs.org' | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: 8.2.0 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
tools: composer:2 | |
php-version: 8.1 | |
coverage: none | |
- name: Setup Magento Repository Credentials | |
run: | | |
composer global config http-basic.repo.magento.com "${MAGENTO_MARKETPLACE_USERNAME}" "${MAGENTO_MARKETPLACE_PASSWORD}" | |
- name: Define Magento ROOT for tests | |
run: echo "Set Magento root to $WORKSPACE" | |
env: | |
MAGEFRONT_TEST_MAGENTO_ROOT: ${{ github.workspace }}/magento | |
- name: Cache Composer packages | |
uses: actions/cache@v3 | |
with: | |
path: ~/.composer/cache | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: | | |
${{ runner.os }}-composer- | |
- name: Create Magento Project | |
id: create-project | |
run: | | |
if [ ! -d "$GITHUB_WORKSPACE/magento/vendor" ]; then | |
composer create-project --ignore-platform-reqs --repository-url=https://repo.magento.com/ magento/project-community-edition "$GITHUB_WORKSPACE/magento" | |
cp .github/_fixtures/config.php.dist "$GITHUB_WORKSPACE/magento/app/etc/config.php" | |
fi | |
- run: pnpm i | |
- run: pnpm build | |
- run: pnpm test | |
env: | |
MAGEFRONT_TEST_MAGENTO_ROOT: ${{ github.workspace }}/magento |