From e7cabe88a6e371e009033a00543a5c0ed59959b6 Mon Sep 17 00:00:00 2001 From: ppshobi <8536607+ppshobi@users.noreply.github.com> Date: Tue, 1 Nov 2022 01:10:28 +0100 Subject: [PATCH 1/9] setup workflow file --- .github/workflows/tests.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..93f73be --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,21 @@ +jobs: + run: + runs-on: ${{ matrix.operating-system }} + strategy: + matrix: + operating-system: [ubuntu-latest, windows-latest, macOS-latest] + php-versions: ['7.2', '7.3', '7.4', '8.0'] + name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }} + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Install PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + - name: Check PHP Version + run: php -v + - name: Composer install + run: composer install + - name: Run phpunit + run: ./vendor/bin/phpunit From 92c0562041d40263c2e5e165983622abc9b1722a Mon Sep 17 00:00:00 2001 From: ppshobi <8536607+ppshobi@users.noreply.github.com> Date: Tue, 1 Nov 2022 01:14:44 +0100 Subject: [PATCH 2/9] add trigger --- .github/workflows/tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 93f73be..0d57695 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,3 +1,5 @@ +on: [push, pull_request] + jobs: run: runs-on: ${{ matrix.operating-system }} From 97e79032f2e1febd6b5b4169bb0731a8328cc725 Mon Sep 17 00:00:00 2001 From: ppshobi <8536607+ppshobi@users.noreply.github.com> Date: Tue, 1 Nov 2022 01:16:45 +0100 Subject: [PATCH 3/9] remove 7.2 --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0d57695..a9f53af 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,7 +6,7 @@ jobs: strategy: matrix: operating-system: [ubuntu-latest, windows-latest, macOS-latest] - php-versions: ['7.2', '7.3', '7.4', '8.0'] + php-versions: ['7.3', '7.4', '8.0'] name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }} steps: - name: Checkout From 969909015d73e9221faf6dc661f7317787310ee3 Mon Sep 17 00:00:00 2001 From: ppshobi <8536607+ppshobi@users.noreply.github.com> Date: Tue, 1 Nov 2022 01:22:06 +0100 Subject: [PATCH 4/9] try running sonic --- .github/workflows/tests.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a9f53af..9f11256 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -3,6 +3,13 @@ on: [push, pull_request] jobs: run: runs-on: ${{ matrix.operating-system }} + services: + sonic: + image: valeriansaliou/sonic:v1.1.9 + ports: + - 1491:1491 + volumes: + - sonic.cfg:/etc/sonic.cfg strategy: matrix: operating-system: [ubuntu-latest, windows-latest, macOS-latest] From f28d679676dd2f780a55bcfdf38470fe2bf6ef38 Mon Sep 17 00:00:00 2001 From: ppshobi <8536607+ppshobi@users.noreply.github.com> Date: Tue, 1 Nov 2022 01:39:23 +0100 Subject: [PATCH 5/9] run docker image as a step --- .github/workflows/tests.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9f11256..1c0b55e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -3,13 +3,6 @@ on: [push, pull_request] jobs: run: runs-on: ${{ matrix.operating-system }} - services: - sonic: - image: valeriansaliou/sonic:v1.1.9 - ports: - - 1491:1491 - volumes: - - sonic.cfg:/etc/sonic.cfg strategy: matrix: operating-system: [ubuntu-latest, windows-latest, macOS-latest] @@ -24,6 +17,8 @@ jobs: php-version: ${{ matrix.php-versions }} - name: Check PHP Version run: php -v + - name: Run Sonic container + run: docker run -d -v ${{ github.workspace }}/sonic.cfg:/etc/sonic.cfg valeriansaliou/sonic:v1.1.9 - name: Composer install run: composer install - name: Run phpunit From e606d6118ffc8c246350e9f8b02e47c8e68249a7 Mon Sep 17 00:00:00 2001 From: ppshobi <8536607+ppshobi@users.noreply.github.com> Date: Tue, 1 Nov 2022 01:41:33 +0100 Subject: [PATCH 6/9] map ports --- .github/workflows/tests.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1c0b55e..c378a5c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -18,7 +18,9 @@ jobs: - name: Check PHP Version run: php -v - name: Run Sonic container - run: docker run -d -v ${{ github.workspace }}/sonic.cfg:/etc/sonic.cfg valeriansaliou/sonic:v1.1.9 + run: docker run -d -p 1491:1491 -v ${{ github.workspace }}/sonic.cfg:/etc/sonic.cfg valeriansaliou/sonic:v1.1.9 + - name: See running containers + run: docker ps - name: Composer install run: composer install - name: Run phpunit From 703146b1d535d5d58f5850b1099ce36b790e5d7b Mon Sep 17 00:00:00 2001 From: ppshobi <8536607+ppshobi@users.noreply.github.com> Date: Tue, 1 Nov 2022 02:00:42 +0100 Subject: [PATCH 7/9] bump sonic version to latest --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c378a5c..0222fcf 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -18,7 +18,7 @@ jobs: - name: Check PHP Version run: php -v - name: Run Sonic container - run: docker run -d -p 1491:1491 -v ${{ github.workspace }}/sonic.cfg:/etc/sonic.cfg valeriansaliou/sonic:v1.1.9 + run: docker run -d -p 1491:1491 -v ${{ github.workspace }}/sonic.cfg:/etc/sonic.cfg valeriansaliou/sonic:v1.4.0 - name: See running containers run: docker ps - name: Composer install From 891be96b4c481c29ad8f3c9cb491d08e23bac5ee Mon Sep 17 00:00:00 2001 From: ppshobi <8536607+ppshobi@users.noreply.github.com> Date: Tue, 1 Nov 2022 02:03:05 +0100 Subject: [PATCH 8/9] remove windows from matrix --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0222fcf..81402f9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -5,7 +5,7 @@ jobs: runs-on: ${{ matrix.operating-system }} strategy: matrix: - operating-system: [ubuntu-latest, windows-latest, macOS-latest] + operating-system: [ubuntu-latest, macOS-latest] php-versions: ['7.3', '7.4', '8.0'] name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }} steps: From 6fbc7eb9f4b41ff6266f58f0a6b5dc9e9ec0c97e Mon Sep 17 00:00:00 2001 From: ppshobi <8536607+ppshobi@users.noreply.github.com> Date: Tue, 1 Nov 2022 02:06:49 +0100 Subject: [PATCH 9/9] remove mac from matrix --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 81402f9..c16a8a5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -5,7 +5,7 @@ jobs: runs-on: ${{ matrix.operating-system }} strategy: matrix: - operating-system: [ubuntu-latest, macOS-latest] + operating-system: [ubuntu-latest] php-versions: ['7.3', '7.4', '8.0'] name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }} steps: