Skip to content

Commit

Permalink
ci(sdk tests): Do not retrieve last tags as it is now useless [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
julienloizelet committed Nov 6, 2024
1 parent 1d79818 commit 21a85d5
Showing 1 changed file with 23 additions and 19 deletions.
42 changes: 23 additions & 19 deletions .github/workflows/php-sdk-development-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ jobs:
- name: Set PHP common variables
id: set-common-data
run: |
echo "major_tag=$(curl -Ls -o /dev/null -w %{url_effective} https://github.com/${{env.PHP_COMMON_REPO}}/releases/latest | grep -oP "\/tag\/v\K(.*)$" | cut -d. -f1)" >> $GITHUB_OUTPUT
echo "branch=${{ fromJson(env.PHP_COMMON_JSON)[0] }}" >> $GITHUB_OUTPUT
if [ "${{ inputs.is_call }}" = "true" ]; then
echo "repo=${{env.PHP_COMMON_REPO}}" >> $GITHUB_OUTPUT
Expand All @@ -118,7 +117,6 @@ jobs:
- name: Set LAPI client variables
id: set-lapi-client-data
run: |
echo "major_tag=$(curl -Ls -o /dev/null -w %{url_effective} https://github.com/${{env.LAPI_CLIENT_REPO}}/releases/latest | grep -oP "\/tag\/v\K(.*)$" | cut -d. -f1)" >> $GITHUB_OUTPUT
echo "branch=${{ fromJson(env.LAPI_CLIENT_JSON)[0] }}" >> $GITHUB_OUTPUT
if [ "${{ inputs.is_call }}" = "true" ]; then
echo "repo=${{env.LAPI_CLIENT_REPO}}" >> $GITHUB_OUTPUT
Expand All @@ -128,7 +126,6 @@ jobs:
- name: Set CAPI client variables
id: set-capi-client-data
run: |
echo "major_tag=$(curl -Ls -o /dev/null -w %{url_effective} https://github.com/${{env.CAPI_CLIENT_REPO}}/releases/latest | grep -oP "\/tag\/v\K(.*)$" | cut -d. -f1)" >> $GITHUB_OUTPUT
echo "branch=${{ fromJson(env.CAPI_CLIENT_JSON)[0] }}" >> $GITHUB_OUTPUT
if [ "${{ inputs.is_call }}" = "true" ]; then
echo "repo=${{env.CAPI_CLIENT_REPO}}" >> $GITHUB_OUTPUT
Expand All @@ -139,7 +136,6 @@ jobs:
- name: Set Remediation engine variables
id: set-remediation-engine-data
run: |
echo "major_tag=$(curl -Ls -o /dev/null -w %{url_effective} https://github.com/${{env.REMEDIATION_ENGINE_REPO}}/releases/latest | grep -oP "\/tag\/v\K(.*)$" | cut -d. -f1)" >> $GITHUB_OUTPUT
echo "branch=${{ fromJson(env.REMEDIATION_ENGINE_JSON)[0] }}" >> $GITHUB_OUTPUT
if [ "${{ inputs.is_call }}" = "true" ]; then
echo "repo=${{env.REMEDIATION_ENGINE_REPO}}" >> $GITHUB_OUTPUT
Expand All @@ -150,7 +146,6 @@ jobs:
- name: Set Bouncer library variables
id: set-bouncer-lib-data
run: |
echo "major_tag=$(curl -Ls -o /dev/null -w %{url_effective} https://github.com/${{env.BOUNCER_LIB_REPO}}/releases/latest | grep -oP "\/tag\/v\K(.*)$" | cut -d. -f1)" >> $GITHUB_OUTPUT
echo "branch=${{ fromJson(env.BOUNCER_LIB_JSON)[0] }}" >> $GITHUB_OUTPUT
if [ "${{ inputs.is_call }}" = "true" ]; then
echo "repo=${{env.BOUNCER_LIB_REPO}}" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -274,24 +269,24 @@ jobs:
- name: Modify dependencies to use development aliases
run: |
# Standalone bouncer
composer require crowdsec/bouncer:"dev-${{ steps.set-bouncer-lib-data.outputs.branch }} as ${{ steps.set-bouncer-lib-data.outputs.major_tag }}.999.0" --no-update --working-dir ./${{env.EXTENSION_PATH}}
composer require crowdsec/common:"dev-${{ steps.set-common-data.outputs.branch }} as ${{ steps.set-common-data.outputs.major_tag }}.999.0" --no-update --working-dir ./${{env.EXTENSION_PATH}}
composer require crowdsec/lapi-client:"dev-${{ steps.set-lapi-client-data.outputs.branch }} as ${{ steps.set-lapi-client-data.outputs.major_tag }}.999.0" --no-update --working-dir ./${{env.EXTENSION_PATH}}
composer require crowdsec/remediation-engine:"dev-${{ steps.set-remediation-engine-data.outputs.branch }} as ${{ steps.set-remediation-engine-data.outputs.major_tag }}.999.0" --no-update --working-dir ./${{env.EXTENSION_PATH}}
composer require crowdsec/capi-client:"dev-${{ steps.set-capi-client-data.outputs.branch }} as ${{ steps.set-capi-client-data.outputs.major_tag }}.999.0" --no-update --working-dir ./${{env.EXTENSION_PATH}}
composer require crowdsec/bouncer:"dev-${{ steps.set-bouncer-lib-data.outputs.branch }} as 999.999.0" --no-update --working-dir ./${{env.EXTENSION_PATH}}
composer require crowdsec/common:"dev-${{ steps.set-common-data.outputs.branch }} as 999.999.0" --no-update --working-dir ./${{env.EXTENSION_PATH}}
composer require crowdsec/lapi-client:"dev-${{ steps.set-lapi-client-data.outputs.branch }} as 999.999.0" --no-update --working-dir ./${{env.EXTENSION_PATH}}
composer require crowdsec/remediation-engine:"dev-${{ steps.set-remediation-engine-data.outputs.branch }} as 999.999.0" --no-update --working-dir ./${{env.EXTENSION_PATH}}
composer require crowdsec/capi-client:"dev-${{ steps.set-capi-client-data.outputs.branch }} as 999.999.0" --no-update --working-dir ./${{env.EXTENSION_PATH}}
# Bouncer lib
composer require crowdsec/common:"dev-${{ steps.set-common-data.outputs.branch }} as ${{ steps.set-common-data.outputs.major_tag }}.999.0" --no-update --working-dir ./${{env.BOUNCER_LIB_PATH}}
composer require crowdsec/lapi-client:"dev-${{ steps.set-lapi-client-data.outputs.branch }} as ${{ steps.set-lapi-client-data.outputs.major_tag }}.999.0" --no-update --working-dir ./${{env.BOUNCER_LIB_PATH}}
composer require crowdsec/remediation-engine:"dev-${{ steps.set-remediation-engine-data.outputs.branch }} as ${{ steps.set-remediation-engine-data.outputs.major_tag }}.999.0" --no-update --working-dir ./${{env.BOUNCER_LIB_PATH}}
composer require crowdsec/capi-client:"dev-${{ steps.set-capi-client-data.outputs.branch }} as ${{ steps.set-capi-client-data.outputs.major_tag }}.999.0" --no-update --working-dir ./${{env.BOUNCER_LIB_PATH}}
composer require crowdsec/common:"dev-${{ steps.set-common-data.outputs.branch }} as 999.999.0" --no-update --working-dir ./${{env.BOUNCER_LIB_PATH}}
composer require crowdsec/lapi-client:"dev-${{ steps.set-lapi-client-data.outputs.branch }} as 999.999.0" --no-update --working-dir ./${{env.BOUNCER_LIB_PATH}}
composer require crowdsec/remediation-engine:"dev-${{ steps.set-remediation-engine-data.outputs.branch }} as 999.999.0" --no-update --working-dir ./${{env.BOUNCER_LIB_PATH}}
composer require crowdsec/capi-client:"dev-${{ steps.set-capi-client-data.outputs.branch }} as 999.999.0" --no-update --working-dir ./${{env.BOUNCER_LIB_PATH}}
# Remediation engine
composer require crowdsec/common:"dev-${{ steps.set-common-data.outputs.branch }} as ${{ steps.set-common-data.outputs.major_tag }}.999.0" --no-update --working-dir ./${{env.REMEDIATION_ENGINE_PATH}}
composer require crowdsec/lapi-client:"dev-${{ steps.set-lapi-client-data.outputs.branch }} as ${{ steps.set-lapi-client-data.outputs.major_tag }}.999.0" --no-update --working-dir ./${{env.REMEDIATION_ENGINE_PATH}}
composer require crowdsec/capi-client:"dev-${{ steps.set-capi-client-data.outputs.branch }} as ${{ steps.set-capi-client-data.outputs.major_tag }}.999.0" --no-update --working-dir ./${{env.REMEDIATION_ENGINE_PATH}}
composer require crowdsec/common:"dev-${{ steps.set-common-data.outputs.branch }} as 999.999.0" --no-update --working-dir ./${{env.REMEDIATION_ENGINE_PATH}}
composer require crowdsec/lapi-client:"dev-${{ steps.set-lapi-client-data.outputs.branch }} as 999.999.0" --no-update --working-dir ./${{env.REMEDIATION_ENGINE_PATH}}
composer require crowdsec/capi-client:"dev-${{ steps.set-capi-client-data.outputs.branch }} as 999.999.0" --no-update --working-dir ./${{env.REMEDIATION_ENGINE_PATH}}
# CAPI client
composer require crowdsec/common:"dev-${{ steps.set-common-data.outputs.branch }} as ${{ steps.set-common-data.outputs.major_tag }}.999.0" --no-update --working-dir ./${{env.CAPI_CLIENT_PATH}}
composer require crowdsec/common:"dev-${{ steps.set-common-data.outputs.branch }} as 999.999.0" --no-update --working-dir ./${{env.CAPI_CLIENT_PATH}}
# LAPI client
composer require crowdsec/common:"dev-${{ steps.set-common-data.outputs.branch }} as ${{ steps.set-common-data.outputs.major_tag }}.999.0" --no-update --working-dir ./${{env.LAPI_CLIENT_PATH}}
composer require crowdsec/common:"dev-${{ steps.set-common-data.outputs.branch }} as 999.999.0" --no-update --working-dir ./${{env.LAPI_CLIENT_PATH}}
- name: Validate composer.json
run: |
Expand Down Expand Up @@ -336,6 +331,15 @@ jobs:
echo $LAPI_CLIENT_VERSION
exit 1
fi
CAPI_CLIENT_VERSION=$(ddev composer show crowdsec/capi-client --working-dir ./${{env.EXTENSION_PATH}} | grep -oP "versions : \* \K(.*)")
if [[ $CAPI_CLIENT_VERSION == "dev-${{ steps.set-capi-client-data.outputs.branch }}" ]]
then
echo "CAPI_CLIENT_VERSION COMPARISON OK"
else
echo "CAPI_CLIENT_VERSION COMPARISON KO"
echo $CAPI_CLIENT_VERSION
exit 1
fi
REMEDIATION_ENGINE_VERSION=$(ddev composer show crowdsec/remediation-engine --working-dir ./${{env.EXTENSION_PATH}} | grep -oP "versions : \* \K(.*)")
if [[ $REMEDIATION_ENGINE_VERSION == "dev-${{ steps.set-remediation-engine-data.outputs.branch }}" ]]
then
Expand Down

0 comments on commit 21a85d5

Please sign in to comment.