Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug CI cache of composite actions #36

Closed
wants to merge 56 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
e9e9a2d
build.sh - same shell flags as everywhere else
keradus Nov 3, 2023
361ff95
extract composite actions
keradus Nov 3, 2023
f49a1c8
no need to specify fetch-depth
keradus Nov 3, 2023
c8fb47b
move execute-deployment to separated job
keradus Nov 3, 2023
b0700a1
automate decisions to run extra fixer calls
keradus Nov 3, 2023
e7231d9
CS
keradus Nov 3, 2023
38b067a
fix
keradus Nov 3, 2023
397af8d
move auto-review to SCA
keradus Nov 3, 2023
44a5ed7
update job name
keradus Nov 3, 2023
b2db833
Revert "update job name"
keradus Nov 3, 2023
7a39aca
Update .github/workflows/sca.yml
keradus Nov 3, 2023
67e2db9
fix flags after changes on master
keradus Nov 3, 2023
b0f4f89
Merge branch 'ci' of github.com:keradus/PHP-CS-Fixer into ci
keradus Nov 3, 2023
7ae5a2b
Autoreview extracted
keradus Nov 3, 2023
b15502a
further cleanup on auto-review and tests suites
keradus Nov 3, 2023
3743bd1
Update .github/composite-actions/install-composer-deps/action.yml
keradus Nov 3, 2023
e672d9f
CS
keradus Nov 3, 2023
4adfbc8
Merge branch 'ci' of github.com:keradus/PHP-CS-Fixer into ci
keradus Nov 3, 2023
f944f63
fix FAST_LINT_TEST_CASES var
keradus Nov 3, 2023
fc0c6e0
nested compose action
keradus Nov 3, 2023
81b1873
code-coverage collected
keradus Nov 3, 2023
e1f40ce
CS
keradus Nov 3, 2023
004257a
divide test:all further
keradus Nov 3, 2023
36fe205
composer normalize
keradus Nov 3, 2023
05688d3
drop outdated flag
keradus Nov 3, 2023
c6b7fac
NO-CACHE check job after cache-purge on repo
keradus Nov 3, 2023
07024c3
kick CI
keradus Nov 3, 2023
2db6d19
even longer composer-cache key, as we not always have lock files
keradus Nov 3, 2023
8a0dcd6
kick CI
keradus Nov 3, 2023
8e3f42d
kick CI 2
keradus Nov 3, 2023
a34a0cf
Update .github/workflows/sca.yml
keradus Nov 3, 2023
576dd87
----- MARKER -----
keradus Nov 4, 2023
45d005d
DEBUG
keradus Nov 4, 2023
c19b0a0
testing
keradus Nov 4, 2023
cc22070
testing
keradus Nov 4, 2023
20c3a81
test 1
keradus Nov 4, 2023
8e19d8c
Revert "test 1"
keradus Nov 4, 2023
90718fc
test 2
keradus Nov 4, 2023
498a8b4
Test 3
keradus Nov 4, 2023
3a063c5
test4
keradus Nov 4, 2023
5cf4c16
cache 5
keradus Nov 4, 2023
7b4e4f3
test 6b
keradus Nov 4, 2023
176d4bc
test 7
keradus Nov 4, 2023
30a2216
Revert "test 7"
keradus Nov 4, 2023
ac4a7a6
test 8
keradus Nov 4, 2023
e359f2c
test 9
keradus Nov 4, 2023
9be35d1
test A
keradus Nov 4, 2023
be8529c
test b
keradus Nov 4, 2023
22ce09d
test c
keradus Nov 4, 2023
b37f065
test d
keradus Nov 4, 2023
741ebb3
kick CI
keradus Nov 4, 2023
1df5a75
test e
keradus Nov 4, 2023
b5a2a5e
kick CI
keradus Nov 4, 2023
1d934e4
test f
keradus Nov 4, 2023
51b789b
docs
keradus Nov 4, 2023
36425c7
cleanup
keradus Nov 4, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/composite-actions/install-composer-deps/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: "Install composer deps"

inputs:
flags:
description: 'Composer flags'
required: false

runs:
using: "composite"
steps:
# Warning!
#
# Use $GITUB_ENV instead of $GITHUB_OUTPUT.
#
# The actions/cache is, on calling it in this composite action, reading the cache,
# and then also registering a shutdown function for whole workflow, to write the cache afterwards.
#
# That registered shutdown function is _NOT_ having access to inputs.* nor steps.*.outputs for
# `path` parameter, which is evaluated on both stages (read and write), yet `key` parameters
# are evaluated on start only and are not affected by this issue.
- name: Get Composer cache directory
shell: bash
run: |
echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV
echo "COMPOSER_CACHE_PHP=$(php -r 'echo PHP_VERSION;')" >> $GITHUB_ENV
- name: Cache Composer dependencies
uses: actions/cache@v3
with:
path: ${{ env.COMPOSER_CACHE_DIR }}
key: Composer-${{ runner.os }}-${{ env.COMPOSER_CACHE_PHP }}-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
Composer-${{ runner.os }}-${{ env.COMPOSER_CACHE_PHP }}-${{ hashFiles('**/composer.json') }}-
Composer-${{ runner.os }}-${{ env.COMPOSER_CACHE_PHP }}-
Composer-${{ runner.os }}-
- name: Install dependencies
uses: nick-invision/retry@v2
with:
timeout_minutes: 5
max_attempts: 5
retry_wait_seconds: 30
# `--no-scripts` to avoid side-effects (e.g. installing dev-tools for all jobs on CI level),
# all executed scripts should be explicit and run only when needed.
command: composer update --optimize-autoloader --no-interaction --no-progress --no-scripts ${{ inputs.flags }}

- name: Show versions of packages
shell: bash
run: composer info -D
32 changes: 32 additions & 0 deletions .github/composite-actions/setup-cache/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: "Setup Cache"

inputs:
os:
description: 'OS version'
required: true
php:
description: 'PHP version'
required: true

runs:
using: "composite"
steps:
- name: Get Composer cache directory
id: composer-cache-dir
shell: bash
run: echo "dir=$(composer config cache-dir)" >> $GITHUB_OUTPUT

- name: SHOW COMPOSER CACHE VAR
shell: bash
run: echo ${{ steps.composer-cache-dir.outputs.dir }}

- name: Cache dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache-dir.outputs.dir }}
key: DEBUG-${{ inputs.os }}-${{ inputs.php }}-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
DEBUG-${{ inputs.os }}-${{ inputs.php }}-${{ hashFiles('**/composer.json') }}-
DEBUG-${{ inputs.os }}-${{ inputs.php }}-
DEBUG-${{ inputs.os }}-
DEBUG-
57 changes: 57 additions & 0 deletions .github/composite-actions/setup-php-with-composer-deps/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: "Setup PHP with Composer deps"

inputs:
os:
description: 'OS version'
required: true
php:
description: 'PHP version'
required: true
php-coverage:
description: 'Enable coverage driver'
required: false
default: 'no'
tools:
description: 'tools'
required: false
default: 'none'
composer-flags:
description: 'Composer flags'
required: false
composer-flex-with-symfony-version:
description: 'Sf version to determine with Flex'
required: false

runs:
using: "composite"
steps:
- name: Resolve PHP tools flag
uses: actions/github-script@v6
id: setup-php-resolve-tools
with:
script: 'return "${{ inputs.composer-flex-with-symfony-version }}" ? "flex" : "none"'
result-encoding: string

- name: Resolve PHP coverage flag
uses: actions/github-script@v6
id: setup-php-resolve-coverage
with:
script: 'return "${{ inputs.php-coverage }}" == "yes" ? "pcov" : "none"'
result-encoding: string

- name: Setup PHP
uses: ./.github/composite-actions/setup-php
with:
version: ${{ inputs.php }}
coverage: ${{ steps.setup-php-resolve-coverage.outputs.result }}
tools: ${{ steps.setup-php-resolve-tools.outputs.result }}, ${{ inputs.tools }}

- name: Configure Symfony Flex
if: inputs.composer-flex-with-symfony-version
shell: bash
run: composer config extra.symfony.require ${{ inputs.composer-flex-with-symfony-version }}

- name: Install Composer deps
uses: ./.github/composite-actions/install-composer-deps
with:
flags: ${{ inputs.composer-flags }}
25 changes: 25 additions & 0 deletions .github/composite-actions/setup-php/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: "Setup PHP"

inputs:
version:
description: 'PHP version'
required: true
coverage:
description: 'coverage mode'
required: false
default: 'none'
tools:
description: 'tools'
required: false
default: 'none'

runs:
using: "composite"
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ inputs.version }}
coverage: ${{ inputs.coverage }}
tools: composer, ${{ inputs.tools }}
extensions: none, curl, dom, json, mbstring, opcache, openssl, simplexml, tokenizer, xml, xmlwriter, zip
12 changes: 0 additions & 12 deletions .github/prlint.json

This file was deleted.

Loading