Skip to content

Commit

Permalink
Improve CI to not launch same tests
Browse files Browse the repository at this point in the history
  • Loading branch information
abdelfetah18 committed Jan 5, 2024
1 parent 97402f7 commit 92e0308
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ jobs:
-not -path './build/*' \
-type f -exec md5sum {} + | LC_ALL=C sort | md5sum | head -n1 | cut -d " " -f1)
echo $app_md5
echo "app_md5=${app_md5}" >> $GITHUB_OUTPUT
id: app_md5sum
- name: 'Test: list ${{ matrix.app }}'
id: cache_md5sum
run: |
Expand All @@ -212,10 +214,12 @@ jobs:
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ matrix.app }}-${{ steps.cache_md5sum.outputs.md5sum_pom_xml }}
key: ${{ runner.os }}-maven-${{ matrix.app }}-${{ steps.app_md5sum.outputs.app_md5 }}
restore-keys: |
${{ runner.os }}-maven-
id: checking_cache
- name: 'Test: starting Sonar'
if: ${{ steps.checking_cache.outputs.cache-hit != 'true' }}
working-directory: /tmp/jhlite/${{ matrix.app }}/
run: |
if [ -f 'src/main/docker/sonar.yml' ]; then
Expand All @@ -224,6 +228,7 @@ jobs:
docker ps -a
fi
- name: 'Test: verify ${{ matrix.app }}'
if: ${{ steps.checking_cache.outputs.cache-hit != 'true' }}
working-directory: /tmp/jhlite/${{ matrix.app }}/
run: |
if [ -f 'mvnw' ]; then
Expand All @@ -235,17 +240,21 @@ jobs:
npm test
fi
- name: 'Test: check local Sonar Analysis'
if: ${{ steps.checking_cache.outputs.cache-hit != 'true' }}
run: |
if [ -f '/tmp/jhlite/${{ matrix.app }}/src/main/docker/sonar.yml' ]; then
./tests-ci/sonar.sh ${{ matrix.app }}
fi
- name: 'Test: copy shell scripts'
if: ${{ steps.checking_cache.outputs.cache-hit != 'true' }}
run: cp ./tests-ci/start.sh /tmp/jhlite/${{ matrix.app }}/
- name: 'Test: start docker compose services'
if: ${{ steps.checking_cache.outputs.cache-hit != 'true' }}
working-directory: ./tests-ci/
run: |
./start_docker_compose.sh /tmp/jhlite/${{ matrix.app }}/
- name: 'Test: start the application'
if: ${{ steps.checking_cache.outputs.cache-hit != 'true' }}
working-directory: /tmp/jhlite/${{ matrix.app }}/
run: |
# TODO: add also 'gradlew' once gradle support is more advanced
Expand Down

0 comments on commit 92e0308

Please sign in to comment.