88 fail-fast : false
99 steps :
1010 - name : Checkout
11- uses : actions/checkout@v2
11+ uses : actions/checkout@v4
1212 with :
1313 fetch-depth : 2
1414
@@ -18,122 +18,65 @@ jobs:
1818 - name : Check that changelog has been updated.
1919 run : git diff --exit-code origin/${{ github.base_ref }} -- CHANGELOG.md && exit 1 || exit 0
2020
21- test -composer-files :
21+ validate -composer-files :
2222 name : Validate composer
2323 runs-on : ubuntu-latest
24+ steps :
25+ - uses : actions/checkout@v4
26+ - name : Validate composer files
27+ run : |
28+ # Note that we don't use the --strict flag on validate due to the
29+ # package drupal/config_entity_revisions 2.0.x-dev being considered a
30+ # version cf.
31+ # https://getcomposer.org/doc/articles/versions.md#branches
32+ docker compose run --rm php composer validate composer.json
33+ - name : Check that composer file is normalized
34+ run : |
35+ docker compose run --rm php composer install
36+ docker compose run --rm php composer normalize --dry-run
37+
38+ test-composer-files :
39+ name : Test composer files
40+ runs-on : ubuntu-latest
2441 strategy :
2542 matrix :
26- php-versions : [ '8.1' ]
2743 dependency-version : [ prefer-lowest, prefer-stable ]
2844 steps :
29- - uses : actions/checkout@master
30- - name : Setup PHP, with composer and extensions
31- uses : shivammathur/setup-php@v2
32- with :
33- php-version : ${{ matrix.php-versions }}
34- extensions : json
35- coverage : none
36- tools : composer:v2
37- # https://github.com/shivammathur/setup-php#cache-composer-dependencies
38- - name : Get composer cache directory
39- id : composer-cache
40- run : echo "::set-output name=dir::$(composer config cache-files-dir)"
41- - name : Cache dependencies
42- uses : actions/cache@v2
43- with :
44- path : ${{ steps.composer-cache.outputs.dir }}
45- key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
46- restore-keys : ${{ runner.os }}-composer-
47- - name : Validate composer files
45+ - uses : actions/checkout@v4
46+ - name : Check that dependencies resolve.
4847 run : |
49- composer config --no-plugins allow-plugins.mglaman/composer-drupal-lenient true
50- composer validate --strict composer.json
51- # Check that dependencies resolve.
52- composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
48+ # Clean up before update (cf. https://www.drupal.org/project/simplesamlphp_auth/issues/3350773)
49+ rm -fr vendor/
50+ docker compose run --rm php composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
5351
5452 php-coding-standards :
5553 name : PHP coding standards
5654 runs-on : ubuntu-latest
57- strategy :
58- matrix :
59- php-versions : [ '8.1' ]
6055 steps :
61- - uses : actions/checkout@master
62- - name : Setup PHP, with composer and extensions
63- uses : shivammathur/setup-php@v2
64- with :
65- php-version : ${{ matrix.php-versions }}
66- extensions : json
67- coverage : none
68- tools : composer:v2
69- # https://github.com/shivammathur/setup-php#cache-composer-dependencies
70- - name : Get composer cache directory
71- id : composer-cache
72- run : echo "::set-output name=dir::$(composer config cache-files-dir)"
73- - name : Cache dependencies
74- uses : actions/cache@v2
75- with :
76- path : ${{ steps.composer-cache.outputs.dir }}
77- key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
78- restore-keys : ${{ runner.os }}-composer-
56+ - uses : actions/checkout@v4
7957 - name : Install Dependencies
8058 run : |
81- composer config --no-plugins allow-plugins.mglaman/composer-drupal-lenient true
82- composer install --no-interaction --no-progress
59+ docker compose run --rm php composer install
8360 - name : PHPCS
8461 run : |
85- composer coding-standards-check/phpcs
62+ docker compose run --rm php composer coding-standards-check/phpcs
8663
8764 php-code-analysis :
8865 name : PHP code analysis
8966 runs-on : ubuntu-latest
90- strategy :
91- matrix :
92- php-versions : [ '8.1' ]
9367 steps :
94- - uses : actions/checkout@master
95- - name : Setup PHP, with composer and extensions
96- uses : shivammathur/setup-php@v2
97- with :
98- php-version : ${{ matrix.php-versions }}
99- extensions : json
100- coverage : none
101- tools : composer:v2
102- # https://github.com/shivammathur/setup-php#cache-composer-dependencies
103- - name : Get composer cache directory
104- id : composer-cache
105- run : echo "::set-output name=dir::$(composer config cache-files-dir)"
106- - name : Cache dependencies
107- uses : actions/cache@v2
108- with :
109- path : ${{ steps.composer-cache.outputs.dir }}
110- key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
111- restore-keys : ${{ runner.os }}-composer-
68+ - uses : actions/checkout@v4
11269 - name : Code analysis
11370 run : |
11471 ./scripts/code-analysis
11572
116- markdownlint :
73+ coding-standards-markdown :
74+ name : Markdown coding standards
11775 runs-on : ubuntu-latest
118- name : markdownlint
11976 steps :
12077 - name : Checkout
121- uses : actions/checkout@v2
122- - name : Get yarn cache directory path
123- id : yarn-cache-dir-path
124- run : echo "::set-output name=dir::$(yarn cache dir)"
125- - name : Cache yarn packages
126- uses : actions/cache@v2
127- id : yarn-cache
128- with :
129- path : ${{ steps.yarn-cache-dir-path.outputs.dir }}
130- key : ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
131- restore-keys : |
132- ${{ runner.os }}-yarn-
133- - name : Yarn install
134- uses : actions/setup-node@v2
135- with :
136- node-version : ' 20'
137- - run : yarn install
138- - name : markdownlint
139- run : yarn coding-standards-check/markdownlint
78+ uses : actions/checkout@v4
79+
80+ - name : Coding standards
81+ run : |
82+ docker compose run --rm markdownlint markdownlint '**/*.md'
0 commit comments