Skip to content

Commit

Permalink
Fix CD, also run on push to main (#544)
Browse files Browse the repository at this point in the history
* Run CD also on push to main

* Fix a small concurrency issue in workflow execution

* Fix CD on Windows by bumping to CIBW v2.16.5

See pypa/cibuildwheel#1740 for details

* Work around macOS's problem with std::optional::value, use macos-14

* Fix uploading and downloading artifacts

See actions/upload-artifact#478 (comment) for details

* Bump to v0.8.1
  • Loading branch information
N-Wouda committed Mar 22, 2024
1 parent 71a5cdb commit 4cf0727
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 15 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ name: CD
on:
release:
types: [ created ]
push:
branches: [ main ]

concurrency:
group: ${{ github.ref }}
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
Expand All @@ -14,7 +16,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
os: [ ubuntu-22.04, windows-2022, macos-14 ]
steps:
- uses: actions/checkout@v4
- name: Install rtools
Expand All @@ -25,19 +27,20 @@ jobs:
choco install rtools -y --no-progress --force --version=4.0.0.20220206
echo "c:\rtools40\ucrt64\bin;" >> $env:GITHUB_PATH
- name: Build wheels
uses: pypa/cibuildwheel@v2.16.3
uses: pypa/cibuildwheel@v2.16.5
with:
package-dir: .
output-dir: dist
- uses: actions/upload-artifact@v4 # upload all wheels
with:
name: dist
name: dist-${{ matrix.os }}
path: ./dist/*

deploy:
name: Deploy to PyPI
needs: [ build ]
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
if: github.event_name == 'release' && github.event.action == 'created'
steps:
- uses: actions/checkout@v4
- name: Set up Python
Expand All @@ -50,7 +53,8 @@ jobs:
pip install poetry
- uses: actions/download-artifact@v4 # download previously built wheels
with:
name: dist
pattern: dist-*
merge-multiple: true
path: dist/
- name: Build sdist
run: poetry build --format sdist
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ on:
branches: [ main ]

concurrency:
group: ${{ github.ref }}
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: >
Build and test pyvrp using ${{ matrix.compiler }}
${{ matrix.compiler-version }} and Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
strategy:
fail-fast: true
matrix:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/DOC.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ permissions:

concurrency:
group: "pages"
cancel-in-progress: false
cancel-in-progress: true

jobs:
deploy:
name: "Build and deploy documentation"
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Set up pages
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pyvrp"
version = "0.8.0"
version = "0.8.1"
description = "A state-of-the-art vehicle routing problem solver."
authors = [
"Niels Wouda <nielswouda@gmail.com>",
Expand Down
6 changes: 3 additions & 3 deletions pyvrp/cpp/ProblemData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,10 +320,10 @@ void ProblemData::validate() const
if (!client.group)
continue;

if (client.group.value() >= numGroups())
if (*client.group >= numGroups())
throw std::out_of_range("Client references invalid group.");

auto const &group = groups_[client.group.value()];
auto const &group = groups_[*client.group];
if (std::find(group.begin(), group.end(), idx) == group.end())
{
auto const *msg = "Client not in the group it references.";
Expand Down Expand Up @@ -355,7 +355,7 @@ void ProblemData::validate() const
throw std::out_of_range("Group references invalid client.");

ProblemData::Client const &clientData = location(client);
if (!clientData.group || clientData.group.value() != idx)
if (!clientData.group || *clientData.group != idx)
{
auto const *msg = "Group references client not in group.";
throw std::invalid_argument(msg);
Expand Down
2 changes: 1 addition & 1 deletion pyvrp/cpp/search/LocalSearch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ void LocalSearch::applyGroupMoves(Route::Node *U,
if (!uData.group)
return;

auto const &group = data.group(uData.group.value());
auto const &group = data.group(*uData.group);
assert(group.mutuallyExclusive);

std::vector<size_t> inSol;
Expand Down

0 comments on commit 4cf0727

Please sign in to comment.