Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ on:
options: [all, linux]
default: all

# A pull request's runs are grouped by its number, not by github.ref: a run GitHub creates after
# the pull request has merged gets the base branch's ref (refs/heads/main), and would otherwise
# join main's group and cancel main's run.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
group: ${{ github.workflow }}-${{ github.event.pull_request.number && format('pr-{0}', github.event.pull_request.number) || github.ref }}
Comment thread
giswqs marked this conversation as resolved.
Resolved
cancel-in-progress: true

env:
Expand Down
15 changes: 9 additions & 6 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,18 @@ permissions:

# One run at a time per ref, so pushes and manual runs on main publish `edge` in order. A publishing
# run always finishes (a cancelled one could leave the CLI's tags half updated); a newer push only
# replaces a run that is still waiting. A pull request's newer push cancels its older run.
# replaces a run that is still waiting. A pull request's newer push cancels its older run. A pull
# request's runs are grouped by its number, not by github.ref: a run GitHub creates after the pull
# request has merged gets refs/heads/main, and would otherwise cancel main's publishing run.
concurrency:
group: docker-${{ github.ref }}
group: docker-${{ github.event.pull_request.number && format('pr-{0}', github.event.pull_request.number) || github.ref }}
Comment thread
giswqs marked this conversation as resolved.
Resolved
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

env:
# Only main and releases publish; a pull request, or a manual run on another branch, only builds
# and smoke-tests. (cli-manifest repeats this in its `if`, where env isn't available.)
PUBLISH: ${{ github.event_name == 'release' || github.ref == 'refs/heads/main' }}
# and smoke-tests. A pull request is told by its event, not its ref: a run created after it merged
# has refs/heads/main. (cli-manifest repeats this in its `if`, where env isn't available.)
PUBLISH: ${{ github.event_name == 'release' || (github.event_name != 'pull_request' && github.ref == 'refs/heads/main') }}
WEB_IMAGE: ghcr.io/opengeos/rustgis
CLI_IMAGE: ghcr.io/opengeos/rustgis-cli
# The tags of both images (docker/metadata-action); `latest` follows main, as `edge` does.
Expand All @@ -62,7 +65,7 @@ env:
type=sha,enable=${{ github.event_name != 'release' }}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
type=raw,value=latest,enable=${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/main' }}

jobs:
web:
Expand Down Expand Up @@ -254,7 +257,7 @@ jobs:
cli-manifest:
name: Command line image (publish)
needs: cli
if: github.repository == 'opengeos/RustGIS' && (github.event_name == 'release' || github.ref == 'refs/heads/main')
if: github.repository == 'opengeos/RustGIS' && (github.event_name == 'release' || (github.event_name != 'pull_request' && github.ref == 'refs/heads/main'))
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ on:
permissions:
contents: read

# A pull request's runs are grouped by its number, not by github.ref: a run GitHub creates after
# the pull request has merged gets the base branch's ref (refs/heads/main), and would otherwise
# join main's group and cancel main's run.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
group: ${{ github.workflow }}-${{ github.event.pull_request.number && format('pr-{0}', github.event.pull_request.number) || github.ref }}
cancel-in-progress: true

jobs:
Expand Down
Loading