EMA-150 #91
Workflow file for this run
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: Test | ||
on: | ||
pull_request: | ||
branches: | ||
- "*" | ||
jobs: | ||
unit-tests: | ||
runs-on: github-actions-runner-emarsys | ||
permissions: | ||
contents: "read" | ||
strategy: | ||
max-parallel: 1 | ||
fail-fast: false | ||
matrix: | ||
magento-versions: | ||
["2.3.5ce", "2.4.0ce", "2.4.2ce", "2.4.4ce", "2.4.6ce"] | ||
steps: | ||
- name: Extract branch name | ||
shell: bash | ||
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT | ||
id: extract_branch | ||
retry: | ||
Check failure on line 25 in .github/workflows/tests.yml GitHub Actions / TestInvalid workflow file
|
||
max_attempts: 3 | ||
- name: Checkout code | ||
shell: bash | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install git -y | ||
git clone --branch ${{ steps.extract_branch.outputs.branch }} https://github.com/emartech/magento2-extension.git | ||
retry: | ||
max_attempts: 3 | ||
- name: Login to GitLab | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ vars.REGISTRY_URL }} | ||
username: ${{ secrets.GITLAB_USER }} | ||
password: ${{ secrets.GITLAB_TOKEN }} | ||
retry: | ||
max_attempts: 3 | ||
- name: Install system tools | ||
shell: bash | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install ca-certificates curl gnupg -y | ||
sudo install -m 0755 -d /etc/apt/keyrings | ||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg | ||
sudo chmod a+r /etc/apt/keyrings/docker.gpg | ||
echo \ | ||
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ | ||
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ | ||
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null | ||
sudo apt-get update | ||
sudo apt-get install docker-compose-plugin docker-buildx-plugin -y | ||
retry: | ||
max_attempts: 3 | ||
- name: Build mage_node image | ||
shell: bash | ||
run: | | ||
cd magento2-extension/dev | ||
DOCKER_BUILDKIT=1 docker build -f testv2/tools/docker/Dockerfile-mage-node --build-arg NPM_TOKEN=$NPM_TOKEN -t "mage_node" . | ||
env: | ||
NPM_TOKEN: ${{ secrets.GITLAB_TOKEN }} | ||
retry: | ||
max_attempts: 3 | ||
- name: Run unittest | ||
shell: bash | ||
run: | | ||
cd magento2-extension | ||
bash dev/testv2/tools/scripts/run-unit.sh | ||
env: | ||
VERSION: ${{ matrix.magento-versions }} | ||
NPM_TOKEN: ${{ secrets.GITLAB_TOKEN }} | ||
retry: | ||
max_attempts: 3 | ||
e2e-tests: | ||
runs-on: github-actions-runner-emarsys | ||
# needs: unit-tests | ||
permissions: | ||
contents: "read" | ||
strategy: | ||
max-parallel: 1 | ||
fail-fast: false | ||
matrix: | ||
magento-versions: | ||
["2.3.5ce", "2.4.0ce", "2.4.2ce", "2.4.4ce", "2.4.6ce"] | ||
steps: | ||
- name: Extract branch name | ||
shell: bash | ||
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT | ||
id: extract_branch | ||
retry: | ||
max_attempts: 3 | ||
- name: Checkout code | ||
shell: bash | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install git -y | ||
git clone --branch ${{ steps.extract_branch.outputs.branch }} https://github.com/emartech/magento2-extension.git | ||
retry: | ||
max_attempts: 3 | ||
- name: Login to GitLab | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ vars.REGISTRY_URL }} | ||
username: ${{ secrets.GITLAB_USER }} | ||
password: ${{ secrets.GITLAB_TOKEN }} | ||
retry: | ||
max_attempts: 3 | ||
- name: Install system tools | ||
shell: bash | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install ca-certificates curl gnupg -y | ||
sudo install -m 0755 -d /etc/apt/keyrings | ||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg | ||
sudo chmod a+r /etc/apt/keyrings/docker.gpg | ||
echo \ | ||
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ | ||
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ | ||
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null | ||
sudo apt-get update | ||
sudo apt-get install docker-compose-plugin docker-buildx-plugin -y | ||
retry: | ||
max_attempts: 3 | ||
- name: Build mage_node image | ||
shell: bash | ||
run: | | ||
cd magento2-extension/dev | ||
DOCKER_BUILDKIT=1 docker build -f testv2/tools/docker/Dockerfile-mage-node --build-arg NPM_TOKEN=$NPM_TOKEN -t "mage_node" . | ||
env: | ||
NPM_TOKEN: ${{ secrets.GITLAB_TOKEN }} | ||
retry: | ||
max_attempts: 3 | ||
- name: Run e2stest | ||
shell: bash | ||
run: | | ||
cd magento2-extension | ||
bash dev/testv2/tools/scripts/run-e2e.sh | ||
env: | ||
VERSION: ${{ matrix.magento-versions }} | ||
NPM_TOKEN: ${{ secrets.GITLAB_TOKEN }} | ||
retry: | ||
max_attempts: 3 |