Skip to content

Commit

Permalink
remove services, change syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippImhof committed Jan 9, 2025
1 parent a74bd7c commit 6738b87
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions .github/workflows/testing-windows.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,52 @@
name: Automated testing
name: Automated testing for Windows

on: [push, pull_request]

env:
php: 8.1
database: pgsql

jobs:
test:
name: Automated testing for Windows
runs-on: windows-2022

services:
postgres:
image: postgres:14
env:
POSTGRES_USER: 'postgres'
POSTGRES_HOST_AUTH_METHOD: 'trust'
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 3
mariadb:
image: mariadb:10
env:
MYSQL_USER: 'root'
MYSQL_ALLOW_EMPTY_PASSWORD: "true"
MYSQL_CHARACTER_SET_SERVER: "utf8mb4"
MYSQL_COLLATION_SERVER: "utf8mb4_unicode_ci"
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 3

strategy:
fail-fast: false
matrix:
php: ['8.1']
moodle-branch: ['MOODLE_401_STABLE', 'MOODLE_405_STABLE']
database: [mariadb, pgsql]

steps:
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Check out repository code
uses: actions/checkout@v4
with:
path: plugin

- name: Setup PHP ${{ matrix.php }}
- name: Setup PHP ${{ env.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
php-version: ${{ env.php }}
ini-values: max_input_vars=5000
coverage: none

- name: Setting up DB pgsql
run: |
$pgService = Get-Service -Name postgresql*
Set-Service -InputObject $pgService -Status running -StartupType automatic
Start-Process -FilePath "$env:PGBIN\pg_isready" -Wait -PassThru
& $env:PGBIN\psql --command="CREATE USER test PASSWORD 'test'" --command="\du"
- name: Creating DB pgsql
run: |
$env:PGBIN\createdb --owner=test test
$env:PGPASSWORD = 'test'
$env:PGBIN\psql --username=test --host=localhost --list test
- name: Initialise moodle-plugin-ci
run: |
composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^4
Expand All @@ -58,7 +58,7 @@ jobs:
- name: Install moodle-plugin-ci
run: moodle-plugin-ci install --plugin ./plugin --db-host=127.0.0.1
env:
DB: ${{ matrix.database }}
DB: ${{ env.database }}
MOODLE_BRANCH: ${{ matrix.moodle-branch }}
MOODLE_APP: false

Expand Down

0 comments on commit 6738b87

Please sign in to comment.