diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 00000000..059a163a --- /dev/null +++ b/.github/release.yml @@ -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: + - "*" diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index a4e84dcb..5443e55a 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -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= 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 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 86e75801..f5567852 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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