Skip to content

Commit bf2005d

Browse files
committed
Fix dependency on MySQL
1 parent 3002daf commit bf2005d

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

.github/workflows/php.yml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,35 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
operating-system: [ubuntu-latest, windows-latest]
16+
operating-system: [ubuntu-latest]
1717
php-versions: ['7.4', '8.0']
1818

1919
steps:
20+
- name: Setup test MySQL database
21+
run: |
22+
sudo systemctl start mysql.service
23+
mysql -uroot -proot -e 'CREATE DATABASE IF NOT EXISTS simplesamlphp;'
24+
mysql -uroot -proot -e '
25+
CREATE TABLE IF NOT EXISTS `AttributeFromSQL` (
26+
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
27+
`uid` VARCHAR(100) NOT NULL,
28+
`sp` VARCHAR(250) DEFAULT "%",
29+
`attribute` VARCHAR(30) NOT NULL,
30+
`value` TEXT,
31+
`expires` DATE DEFAULT "9999-12-31",
32+
PRIMARY KEY (`id`)
33+
) DEFAULT CHARSET=utf8;
34+
CREATE USER IF NOT EXISTS `phpunit`@`localhost` IDENTIFIED BY "phpunit";
35+
GRANT ALL ON `simplesamlphp`.* TO `phpunit`@`localhost`;
36+
' simplesamlphp
37+
mysql -uroot -proot -e "
38+
INSERT INTO AttributeFromSQL (uid, sp, attribute, value) VALUES ('user@example.org', '%', 'eduPersonEntitlement', 'urn:mace:exampleIdP.org:demoservice:demo-admin');
39+
INSERT INTO AttributeFromSQL (uid, sp, attribute, value) VALUES ('user@example.org', 'https://idp.example.org/idp/shibboleth', 'eduPersonEntitlement', 'urn:mace:grnet.gr:eduroam:admin');
40+
INSERT INTO AttributeFromSQL (uid, sp, attribute, value) VALUES ('user@example.org', '%', 'eduPersonAffiliation', 'faculty');
41+
INSERT INTO AttributeFromSQL (uid, attribute, value) VALUES ('user@example.org', 'mail', 'user@example.org');
42+
INSERT INTO AttributeFromSQL (uid, attribute, value, expires) VALUES ('user@example.org', 'mail', 'marty@example.org', '2015-10-21');
43+
" simplesamlphp
44+
2045
- name: Setup PHP, with composer and extensions
2146
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
2247
with:

0 commit comments

Comments
 (0)