Skip to content

Commit

Permalink
🔧 Update CI (#93)
Browse files Browse the repository at this point in the history
Add dependabot, and move deployment to CI workflow
  • Loading branch information
chrisjsewell authored Nov 28, 2023
1 parent 2e3bfce commit 97a8f30
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 131 deletions.
19 changes: 19 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: github-actions
directory: /
commit-message:
prefix: ⬆️
schedule:
interval: weekly
- package-ecosystem: pip
directory: /
commit-message:
prefix: ⬆️
schedule:
interval: weekly
117 changes: 0 additions & 117 deletions .github/workflows/cd.yml

This file was deleted.

70 changes: 56 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
name: CI

on: [push, pull_request]

on:
push:
branches: [master]
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"
pull_request:

jobs:

pre-commit:

runs-on: ubuntu-latest

steps:
- uses: actions/[email protected]
- name: Set up Python
uses: actions/[email protected]
with:
python-version: "3.8"
- name: Make sure virtualevn>20 is installed, which will yield newer pip and possibility to pin pip version.
run: pip install "virtualenv>20"
- name: Install Tox
run: pip install tox
- name: Run pre-commit in Tox
run: tox -e pre-commit

- uses: actions/checkout@v4
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: "3.8"
- uses: pre-commit/[email protected]

tests:

name: pytest (Python ${{ matrix.python-version }}, LAMMPS ${{ matrix.lammps-version }})

timeout-minutes: 30

strategy:
Expand Down Expand Up @@ -94,3 +97,42 @@ jobs:
name: pytests-lammps
flags: pytests
fail_ci_if_error: true

# https://github.com/marketplace/actions/alls-green#why
check: # This job does nothing and is only used for the branch protection

if: always()

needs:
- pre-commit
- tests

runs-on: ubuntu-latest

steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}

publish:
name: Publish to PyPi
needs: [pre-commit, tests]
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/[email protected]
- name: Set up Python 3.8
uses: actions/[email protected]
with:
python-version: "3.8"
- name: install flit
run: |
pip install flit~=3.4
- name: Build and publish
run: |
flit publish
env:
FLIT_USERNAME: __token__
FLIT_PASSWORD: ${{ secrets.PYPI_KEY }}

0 comments on commit 97a8f30

Please sign in to comment.