Skip to content

Commit

Permalink
Merge pull request #143 from openkim/devel
Browse files Browse the repository at this point in the history
Update GH actions to use latest conda-forge kim-api and test on macOS
  • Loading branch information
mjwen authored Dec 17, 2023
2 parents 68691b6 + f7fadc0 commit 35b9228
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 37 deletions.
19 changes: 19 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
changelog:
exclude:
authors: [dependabot, github-actions]
categories:
- title: New Features 🎉
labels:
- feature
- title: Bug Fixes 🐛
labels:
- fix
- title: Enhancements 🛠
labels:
- enhancement
- title: Documentation 📖
labels:
- documentation
- title: Other Changes
labels:
- "*"
59 changes: 23 additions & 36 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,67 +8,54 @@ jobs:

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4.7.1
with:
python-version: "3.9"
python-version: "3.10"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pre-commit
- name: Lint
run: pre-commit run --show-diff-on-failure --all-files

test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.8", "3.9"]
os: [ubuntu-latest, macos-latest]
python-version: ["3.8", "3.9", "3.10"]

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

steps:
- uses: actions/checkout@v4

- name: Install gcc
run: |
sudo apt-get update
sudo apt-get install -yq gcc
sudo apt-get install -yq gfortran
# cannot install cmake with apt-get, so using this action
- uses: lukka/get-cmake@latest
- name: Set up micromamba
uses: mamba-org/setup-micromamba@v1.7.3
with:
cmakeVersion: "~3.25.0"

- name: Install kim-api
# the create command looks like this:
# `micromamba create -n test-env python=<the corresponding version> kim-api=2.3.0`
environment-name: test-env
cache-environment: true
create-args: >-
python=${{ matrix.python-version }}
kim-api=2.3.0
- name: Install KIM model
shell: bash -el {0}
run: |
export KIMAPI_DIR=${PWD}
export KIM_API_VERSION="2.3.0"
cd $KIMAPI_DIR && cd ..
wget http://s3.openkim.org/kim-api/kim-api-$KIM_API_VERSION.txz
tar Jxvf kim-api-$KIM_API_VERSION.txz
cd kim-api-$KIM_API_VERSION
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j2
sudo make install
sudo ldconfig
# install SW driver and model
cd $KIMAPI_DIR
kim-api-collections-management install user SW_StillingerWeber_1985_Si__MO_405512056662_006
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4.7.1
with:
python-version: ${{ matrix.python-version }}

- name: Install
shell: bash -el {0}
run: |
python -m pip install --upgrade pip
python -m pip install .[test]
- name: Test with pytest
- name: Run tests
shell: bash -el {0}
run: |
cd tests
pytest
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ repos:
- --filter-files
exclude: ^docs/

- repo: https://github.com/psf/black
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.12.0
hooks:
- id: black
Expand Down

0 comments on commit 35b9228

Please sign in to comment.