Skip to content

Commit

Permalink
Force testing
Browse files Browse the repository at this point in the history
Signed-off-by: Jose Luis Rivero <[email protected]>
  • Loading branch information
j-rivero committed Oct 2, 2023
1 parent 769d526 commit 70e626b
Showing 1 changed file with 0 additions and 32 deletions.
32 changes: 0 additions & 32 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,45 +12,18 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Idenfify files changed in this PR
id: files
run: |
git fetch origin ${{ github.ref }}
git diff --name-only origin/${{ github.base_ref }}...FETCH_HEAD
echo "changed-files=$(git diff --name-only origin/${{ github.base_ref }}...FETCH_HEAD| tr '\n' ' ')" >> $GITHUB_OUTPUT
- name: Run testing on changed config files in PRs
if: github.event_name == 'pull_request'
id: dsl_check
run: |
for changed_file in ${{ steps.files.outputs.changed-files }}; do
if [[ ${changed_file} != ${changed_file/dsl\/*} ]]; then
echo "+ Detected at leat one config file: ${changed_file}."
echo "run_job=true" >> $GITHUB_OUTPUT
break
else
echo "run_job=false" >> $GITHUB_OUTPUT
fi
done
- name: Run testing always on not PRs
if: github.event_name != 'pull_request'
id: dsl_check
run: echo "run_job=true" >> $GITHUB_OUTPUT
- name: Checkout
if: steps.dsl_check.outputs.run_job == 'true'
uses: actions/checkout@v3
with:
fetch-depth: 2
- uses: actions/setup-java@v3
if: steps.dsl_check.outputs.run_job == 'true'
with:
distribution: 'temurin'
java-version: '11'
- name: Download and setup job dsl jar
if: steps.dsl_check.outputs.run_job == 'true'
run: ./jenkins-scripts/dsl/tools/setup_local_generation.bash

- name: Generate all DSL files
if: steps.dsl_check.outputs.run_job == 'true'
run: |
# simulate token for brew_release
sudo mkdir -p /var/lib/jenkins/ && sudo touch /var/lib/jenkins/remote_token
Expand All @@ -62,7 +35,6 @@ jobs:
mv *.xml /tmp/pr_xml_configuration/
mv *.txt /tmp/pr_log_generated/
- name: Generate master DSL files
if: steps.dsl_check.outputs.run_job == 'true'
run: |
git clean -f -e jobdsl.jar
git checkout master
Expand All @@ -72,26 +44,22 @@ jobs:
mv *.xml /tmp/current_xml_configuration/
mv *.txt /tmp/current_log_generated/ || true
- name: Generating diffs
if: steps.dsl_check.outputs.run_job == 'true'
run: |
# somehow the Jenkins views changed the portlet_ id on every run.
diff -qr -I '.*<id>dashboard_portlet_.*</id>.*' /tmp/current_xml_configuration /tmp/pr_xml_configuration > /tmp/xml_config_files_changed.diff || true
diff -ur -I '.*<id>dashboard_portlet_.*</id>.*' /tmp/current_xml_configuration /tmp/pr_xml_configuration > /tmp/xml_config_content_changed.diff || true
diff -ur /tmp/current_log_generated /tmp/pr_log_generated > /tmp/log_content_changed.diff || true
- name: Archive files changes
if: steps.dsl_check.outputs.run_job == 'true'
uses: actions/upload-artifact@v3
with:
name: xml_config_files_changed
path: /tmp/xml_config_files_changed.diff
- name: Archive content changes
if: steps.dsl_check.outputs.run_job == 'true'
uses: actions/upload-artifact@v3
with:
name: xml_config_content_changed
path: /tmp/xml_config_content_changed.diff
- name: Archive log changes
if: steps.dsl_check.outputs.run_job == 'true'
uses: actions/upload-artifact@v3
with:
name: log_content_changed
Expand Down

0 comments on commit 70e626b

Please sign in to comment.