ci: reduced build on pushes to master and stable in forks (#1991)

* ci: reduced build on pushes to master and stable in forks

* ci: master pushes finish their cache saves

* ci: test retry message only when retrying
This commit is contained in:
Evgeny @ SimpleX Chat authored and GitHub committed 2026-10-26 18:02:44 +00:00
1 parent 195df0d094
commit c9b3de83fe
3 files changed
+9 -8

No files matched your search

+4 -3
View File
@@ -18,7 +18,7 @@ on:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ !startsWith(github.ref, 'refs/tags/v') }}
cancel-in-progress: ${{ github.event_name != 'push' }}
jobs:
@@ -32,7 +32,7 @@ jobs:
maybe-release:
runs-on: ubuntu-latest
outputs:
reduced: ${{ github.event_name == 'workflow_dispatch' || github.event.pull_request.draft == true }}
reduced: ${{ github.event_name == 'workflow_dispatch' || github.event.pull_request.draft == true || (github.event_name == 'push' && github.ref_type == 'branch' && github.repository != 'simplex-chat/simplexmq') }}
steps:
- name: Reject a manual run on a tag
if: github.event_name == 'workflow_dispatch' && github.ref_type == 'tag'
@@ -260,6 +260,7 @@ jobs:
run: scripts/ci/source-timestamps.sh restore ${{ env.source_hashes }}
- name: Build smp-server, xftp-server (postgresql) and tests
id: build-postgres
if: matrix.should_run == true
shell: docker exec -t builder sh -eu {0}
run: |
@@ -418,7 +419,7 @@ jobs:
- name: Remove -O2 build directories
id: remove-o2
if: env.cache_o0 == 'true' && !cancelled() && steps.build-standard.outcome == 'success'
if: env.cache_o0 == 'true' && !cancelled() && steps.build-postgres.outcome == 'success' && steps.build-standard.outcome != 'failure'
shell: docker exec -t builder sh -eu {0}
run: rm -rf dist-newstyle dist-postgres
+2 -2
View File
@@ -6,8 +6,8 @@
| Trigger | Build | Jobs |
|---|---|---|
| a push to a draft pull request<br>a manual run (workflow_dispatch) | reduced | build-reduced: ubuntu-24.04 x86-64, GHC 9.6.3, at -O0, without the standard build |
| a pull request marked ready for review, and later pushes to it<br>a push to master or stable<br>a push of a v* tag | full | build: 5 entries (GHC 8.10.7 and 9.6.3, x86-64 and aarch64), at -O0 on pull requests and -O2 on pushes |
| a push to a draft pull request<br>a manual run (workflow_dispatch)<br>a push to master or stable in a fork | reduced | build-reduced: ubuntu-24.04 x86-64, GHC 9.6.3, at -O0 (-O2 on pushes), without the standard build |
| a pull request marked ready for review, and later pushes to it<br>a push to master or stable in simplex-chat/simplexmq<br>a push of a v* tag | full | build: 5 entries (GHC 8.10.7 and 9.6.3, x86-64 and aarch64), at -O0 on pull requests and -O2 on pushes |
Both builds also run maybe-release and resolver (python). Tests run on the x86-64 entries. The reduced build restores the -O0 build caches saved by master pushes; the Docker image cache is tagged by ISO week, so the first run of a week rebuilds the image.
+3 -3
View File
@@ -26,13 +26,13 @@ attempts=${ATTEMPTS:-1}
while [ "$i" -le "$attempts" ]; do
if "$@" "${args[@]}"; then
break
else
elif [ "$i" -lt "$attempts" ]; then
echo "Attempt $i failed, retrying..."
i=$((i + 1))
sleep 1
fi
i=$((i + 1))
done
if [ "$i" -gt "$attempts" ]; then
echo "All $attempts attempts failed."
echo "Attempt $attempts failed."
exit 1
fi