Skip to content

Commit

Permalink
Fix GA workflow for macos (dftd4#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
marvinfriede authored Apr 25, 2024
1 parent 3f5bef3 commit c9a2880
Show file tree
Hide file tree
Showing 5 changed files with 199 additions and 21 deletions.
97 changes: 97 additions & 0 deletions .github/workflows/macos.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# This file is part of tad-dftd4.
#
# SPDX-Identifier: Apache-2.0
# Copyright (C) 2024 Grimme Group
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Tests (macOS)

on:
push:
branches:
- main
- master
paths-ignore:
- "doc*/**"
- "./*.ya?ml"
- "**/*.md"
- "**/*.rst"

pull_request:
paths-ignore:
- "doc*/**"
- "./*.ya?ml"
- "**/*.md"
- "**/*.rst"

workflow_dispatch:

jobs:
main:
strategy:
fail-fast: false
matrix:
os: [macos-12, macos-13, macos-14]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
# only test oldest and newest version of torch
torch-version: ["1.11.0", "2.2.2"]
exclude:
# PyTorch now fully supports Python=<3.11
# see: https://github.com/pytorch/pytorch/issues/86566
#
# PyTorch does not support Python 3.12 (all platforms)
# see: https://github.com/pytorch/pytorch/issues/110436
- python-version: "3.12"
# PyTorch<1.13.0 does only support Python=<3.10
# On macOS and Windows, 1.13.x is also not supported for Python>=3.10
- python-version: "3.11"
torch-version: "1.11.0"
- python-version: "3.11"
torch-version: "1.12.1"
- python-version: "3.11"
torch-version: "1.13.1"
# Python 3.8/3.9 is not on macos-latest (macos-14-arm64)
# https://github.com/actions/setup-python/issues/696
- os: macos-14
python-version: "3.8"
- os: macos-14
python-version: "3.9"

runs-on: ${{ matrix.os }}

defaults:
run:
shell: bash {0}

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install tox
- name: Determine TOXENV
run: echo "TOXENV=py$(echo ${{ matrix.python-version }} | tr -d '.')-torch$(echo ${{ matrix.torch-version }} | tr -d '.')" >> $GITHUB_ENV

- name: Print TOXENV
run: echo "TOXENV is set to '${{ env.TOXENV }}'."

- name: Unittests with tox
run: tox -e ${{ env.TOXENV }}
20 changes: 4 additions & 16 deletions .github/workflows/python.yaml → .github/workflows/ubuntu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Tests
name: Tests (Ubuntu)

on:
push:
Expand All @@ -41,7 +41,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
torch-version: ["1.11.0", "1.12.1", "1.13.1", "2.0.1", "2.1.2", "2.2.2"]
exclude:
Expand All @@ -50,24 +50,12 @@ jobs:
#
# PyTorch does not support Python 3.12 (all platforms)
# see: https://github.com/pytorch/pytorch/issues/110436
- os: ubuntu-latest
python-version: "3.12"
- os: macos-latest
python-version: "3.12"
- os: windows-latest
python-version: "3.12"
- python-version: "3.12"
# PyTorch<1.13.0 does only support Python=<3.10
- python-version: "3.11"
torch-version: "1.11.0"
- python-version: "3.11"
torch-version: "1.12.1"
# On macOS and Windows, 1.13.x is also not supported for Python>=3.10
- os: macos-latest
python-version: "3.11"
torch-version: "1.13.1"
- os: windows-latest
python-version: "3.11"
torch-version: "1.13.1"

runs-on: ${{ matrix.os }}

Expand All @@ -80,7 +68,7 @@ jobs:
uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand Down
93 changes: 93 additions & 0 deletions .github/workflows/windows.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# This file is part of tad-dftd4.
#
# SPDX-Identifier: Apache-2.0
# Copyright (C) 2024 Grimme Group
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Tests (Windows)

on:
push:
branches:
- main
- master
paths-ignore:
- "doc*/**"
- "./*.ya?ml"
- "**/*.md"
- "**/*.rst"

pull_request:
paths-ignore:
- "doc*/**"
- "./*.ya?ml"
- "**/*.md"
- "**/*.rst"

workflow_dispatch:

jobs:
main:
strategy:
fail-fast: false
matrix:
os: [windows-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
# only test oldest and newest version of torch
torch-version: ["1.11.0", "2.2.2"]
exclude:
# PyTorch now fully supports Python=<3.11
# see: https://github.com/pytorch/pytorch/issues/86566
#
# PyTorch does not support Python 3.12 (all platforms)
# see: https://github.com/pytorch/pytorch/issues/110436
- os: windows-latest
python-version: "3.12"
# PyTorch<1.13.0 does only support Python=<3.10
- python-version: "3.11"
torch-version: "1.11.0"
- python-version: "3.11"
torch-version: "1.12.1"
# On macOS and Windows, 1.13.x is also not supported for Python>=3.10
- os: windows-latest
python-version: "3.11"
torch-version: "1.13.1"

runs-on: ${{ matrix.os }}

defaults:
run:
shell: bash {0}

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install tox
- name: Determine TOXENV
run: echo "TOXENV=py$(echo ${{ matrix.python-version }} | tr -d '.')-torch$(echo ${{ matrix.torch-version }} | tr -d '.')" >> $GITHUB_ENV

- name: Print TOXENV
run: echo "TOXENV is set to '${{ env.TOXENV }}'."

- name: Unittests with tox
run: tox -e ${{ env.TOXENV }}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
<tr>
<td>Status:</td>
<td>
<a href="https://github.com/dftd4/tad-dftd4/actions/workflows/python.yaml">
<img src="https://github.com/dftd4/tad-dftd4/actions/workflows/python.yaml/badge.svg" alt="Test Status"/>
<a href="https://github.com/dftd4/tad-dftd4/actions/workflows/ubuntu.yaml">
<img src="https://github.com/dftd4/tad-dftd4/actions/workflows/ubuntu.yaml/badge.svg" alt="Test Status Ubuntu"/>
</a>
<a href="https://github.com/dftd4/tad-dftd4/actions/workflows/release.yaml">
<img src="https://github.com/dftd4/tad-dftd4/actions/workflows/release.yaml/badge.svg" alt="Build Status"/>
Expand Down
6 changes: 3 additions & 3 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ Torch autodiff for DFT-D4
:target: http://www.apache.org/licenses/LICENSE-2.0
:alt: Apache-2.0

.. image:: https://github.com/dftd4/tad-dftd4/actions/workflows/python.yaml/badge.svg
:target: https://github.com/dftd4/tad-dftd4/actions/workflows/python.yaml
:alt: CI
.. image:: https://github.com/dftd4/tad-dftd4/actions/workflows/ubuntu.yaml/badge.svg
:target: https://github.com/dftd4/tad-dftd4/actions/workflows/ubuntu.yaml
:alt: Test Status Ubuntu

.. image:: https://readthedocs.org/projects/tad-dftd4/badge/?version=latest
:target: https://tad-dftd4.readthedocs.io
Expand Down

0 comments on commit c9a2880

Please sign in to comment.