Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 07e0992

Browse files
authored
Make GHA config more efficient (#10383)
A few things here: * Build the debs for single distro for each PR, so that we can see if it breaks. Do the same for develop. Building all the debs ties up the GHA workers for ages. * Stop building the debs for release branches. Again, it takes ages, and I don't think anyone is actually going to stop and look at them. We'll know they are working when we make an RC. * Change the configs so that if we manually cancel a workflow, it actually does something.
1 parent eb3beb8 commit 07e0992

File tree

3 files changed

+21
-15
lines changed

3 files changed

+21
-15
lines changed

.github/workflows/release-artifacts.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,33 @@
33
name: Build release artifacts
44

55
on:
6+
# we build on PRs and develop to (hopefully) get early warning
7+
# of things breaking (but only build one set of debs)
8+
pull_request:
69
push:
7-
# we build on develop and release branches to (hopefully) get early warning
8-
# of things breaking
9-
branches: ["develop", "release-*"]
10+
branches: ["develop"]
1011

11-
# we also rebuild on tags, so that we can be sure of picking the artifacts
12-
# from the right tag.
12+
# we do the full build on tags.
1313
tags: ["v*"]
1414

1515
permissions:
1616
contents: write
1717

1818
jobs:
19-
# first get the list of distros to build for.
2019
get-distros:
20+
name: "Calculate list of debian distros"
2121
runs-on: ubuntu-latest
2222
steps:
2323
- uses: actions/checkout@v2
2424
- uses: actions/setup-python@v2
2525
- id: set-distros
2626
run: |
27-
echo "::set-output name=distros::$(scripts-dev/build_debian_packages --show-dists-json)"
27+
# if we're running from a tag, get the full list of distros; otherwise just use debian:sid
28+
dists='["debian:sid"]'
29+
if [[ $GITHUB_REF == refs/tags/* ]]; then
30+
dists=$(scripts-dev/build_debian_packages --show-dists-json)
31+
fi
32+
echo "::set-output name=distros::$dists"
2833
# map the step outputs to job outputs
2934
outputs:
3035
distros: ${{ steps.set-distros.outputs.distros }}
@@ -66,7 +71,7 @@ jobs:
6671
# if it's a tag, create a release and attach the artifacts to it
6772
attach-assets:
6873
name: "Attach assets to release"
69-
if: startsWith(github.ref, 'refs/tags/')
74+
if: ${{ !failure() && !cancelled() && startsWith(github.ref, 'refs/tags/') }}
7075
needs:
7176
- build-debs
7277
- build-sdist

.github/workflows/tests.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,14 @@ jobs:
6565

6666
# Dummy step to gate other tests on without repeating the whole list
6767
linting-done:
68-
if: ${{ always() }} # Run this even if prior jobs were skipped
68+
if: ${{ !cancelled() }} # Run this even if prior jobs were skipped
6969
needs: [lint, lint-crlf, lint-newsfile, lint-sdist]
7070
runs-on: ubuntu-latest
7171
steps:
7272
- run: "true"
7373

7474
trial:
75-
if: ${{ !failure() }} # Allow previous steps to be skipped, but not fail
75+
if: ${{ !cancelled() && !failure() }} # Allow previous steps to be skipped, but not fail
7676
needs: linting-done
7777
runs-on: ubuntu-latest
7878
strategy:
@@ -131,7 +131,7 @@ jobs:
131131
|| true
132132
133133
trial-olddeps:
134-
if: ${{ !failure() }} # Allow previous steps to be skipped, but not fail
134+
if: ${{ !cancelled() && !failure() }} # Allow previous steps to be skipped, but not fail
135135
needs: linting-done
136136
runs-on: ubuntu-latest
137137
steps:
@@ -156,7 +156,7 @@ jobs:
156156
157157
trial-pypy:
158158
# Very slow; only run if the branch name includes 'pypy'
159-
if: ${{ contains(github.ref, 'pypy') && !failure() }}
159+
if: ${{ contains(github.ref, 'pypy') && !failure() && !cancelled() }}
160160
needs: linting-done
161161
runs-on: ubuntu-latest
162162
strategy:
@@ -185,7 +185,7 @@ jobs:
185185
|| true
186186
187187
sytest:
188-
if: ${{ !failure() }}
188+
if: ${{ !failure() && !cancelled() }}
189189
needs: linting-done
190190
runs-on: ubuntu-latest
191191
container:
@@ -245,7 +245,7 @@ jobs:
245245
/logs/**/*.log*
246246
247247
portdb:
248-
if: ${{ !failure() }} # Allow previous steps to be skipped, but not fail
248+
if: ${{ !failure() && !cancelled() }} # Allow previous steps to be skipped, but not fail
249249
needs: linting-done
250250
runs-on: ubuntu-latest
251251
strategy:
@@ -286,7 +286,7 @@ jobs:
286286
- run: .buildkite/scripts/test_synapse_port_db.sh
287287

288288
complement:
289-
if: ${{ !failure() }}
289+
if: ${{ !failure() && !cancelled() }}
290290
needs: linting-done
291291
runs-on: ubuntu-latest
292292
container:

changelog.d/10383.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Make the Github Actions workflow configuration more efficient.

0 commit comments

Comments
 (0)