Skip to content

Commit

Permalink
Merge pull request #78 from pyiron/github_actions
Browse files Browse the repository at this point in the history
cleanup github actions
  • Loading branch information
jan-janssen authored Nov 24, 2023
2 parents f8adeb0 + d582991 commit af462e2
Show file tree
Hide file tree
Showing 13 changed files with 88 additions and 168 deletions.
57 changes: 0 additions & 57 deletions .ci_support/condamerge.py

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/black.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: psf/black@stable
with:
options: "--check --diff"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
if: (github.actor == 'dependabot[bot]')
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }} # Check out the head of the actual branch, not the PR
fetch-depth: 0 # otherwise, you will fail to push refs to dest repo
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@ jobs:
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/atomistics
url: https://pypi.org/p/${{ github.event.repository.name }}
permissions:
id-token: write
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.11"

- name: Install dependencies
run: >-
python -m pip install --user --upgrade setuptools wheel
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/format_black.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# This workflow will checkout the branch of the PR, apply black formatting and commit the result to the PR. Does not work for forks.

name: Format black

on:
pull_request:
types: [labeled]

jobs:
build:
if: contains(github.event.pull_request.labels.*.name, 'format_black' )
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.DEPENDABOT_WORKFLOW_TOKEN }}
ref: ${{ github.event.pull_request.head.ref }} # Check out the head of the actual branch, not the PR
fetch-depth: 0 # otherwise, you will fail to push refs to dest repo
- name: format black
uses: psf/black@stable
with:
options: ""
src: "./${{ github.event.repository.name }}"
- name: commit
run: |
git config --local user.email "[email protected]"
git config --local user.name "pyiron-runner"
git commit -m "Format black" -a
- name: push
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.DEPENDABOT_WORKFLOW_TOKEN }}
branch: ${{ github.event.pull_request.head.ref }}
18 changes: 4 additions & 14 deletions .github/workflows/minimal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,11 @@ on:
pull_request:
branches: [ main ]

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}

jobs:
build:

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Setup Mambaforge
uses: conda-incubator/setup-miniconda@v2
with:
Expand All @@ -24,16 +19,11 @@ jobs:
channels: conda-forge
channel-priority: strict
activate-environment: my-env
environment-file: .ci_support/environment.yml
use-mamba: true
- name: Update environment
run: mamba env update -n my-env -f .ci_support/environment.yml
- name: Setup
shell: bash -l {0}
run: |
pip install --no-deps .
- name: Test
shell: bash -l {0}
timeout-minutes: 30
run: |
coverage run --omit atomistics/_version.py -m unittest discover tests
coverage combine
pip install --no-deps .
python -m unittest discover tests
16 changes: 6 additions & 10 deletions .github/workflows/notebooks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@ on:

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Merge Notebook environment
run: |
python .ci_support/condamerge.py --base .ci_support/environment.yml --add .ci_support/environment-notebooks.yml > environment.yml
cp .ci_support/environment.yml environment.yml
tail --lines=+4 .ci_support/environment-abinit.yml >> environment.yml
- name: Setup Mambaforge
uses: conda-incubator/setup-miniconda@v2
with:
Expand All @@ -26,13 +25,10 @@ jobs:
channels: conda-forge
channel-priority: strict
activate-environment: my-env
environment-file: environment.yml
use-mamba: true
- name: Update environment
run: mamba env update -n my-env -f environment.yml
- name: Setup
- name: Test
shell: bash -l {0}
run: |
pip install --no-deps .
- name: Test
shell: bash -l {0}
run: ./.ci_support/build_notebooks.sh
./.ci_support/build_notebooks.sh
7 changes: 2 additions & 5 deletions .github/workflows/pypicheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@ on:

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Setup Mambaforge
uses: conda-incubator/setup-miniconda@v2
with:
Expand All @@ -23,9 +21,8 @@ jobs:
channels: conda-forge
channel-priority: strict
activate-environment: my-env
environment-file: .ci_support/environment.yml
use-mamba: true
- name: Update environment
run: mamba env update -n my-env -f .ci_support/environment.yml
- name: Pip check
shell: bash -l {0}
run: |
Expand Down
33 changes: 12 additions & 21 deletions .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,8 @@ on:
pull_request:
branches: [ main ]

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}

jobs:
build:

runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
Expand Down Expand Up @@ -43,7 +38,16 @@ jobs:
prefix: /usr/share/miniconda3/envs/my-env

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Setup environment (windows)
if: matrix.operating-system == 'windows-latest'
run: cp .ci_support/environment.yml environment.yml
- name: Setup environment (unix)
if: matrix.operating-system != 'windows-latest'
shell: bash -l {0}
run: |
cp .ci_support/environment.yml environment.yml
tail --lines=+4 .ci_support/environment-lammps.yml >> environment.yml
- name: Setup Mambaforge
uses: conda-incubator/setup-miniconda@v2
with:
Expand All @@ -52,26 +56,13 @@ jobs:
channels: conda-forge
channel-priority: strict
activate-environment: my-env
environment-file: environment.yml
use-mamba: true
- name: Setup environment (windows)
if: matrix.operating-system == 'windows-latest'
run: cp .ci_support/environment.yml environment.yml
- name: Setup environment (unix)
if: matrix.operating-system != 'windows-latest'
shell: bash -l {0}
run: |
mamba install -y pyyaml
python .ci_support/condamerge.py --base .ci_support/environment.yml --add .ci_support/environment-lammps.yml > environment.yml
- name: Update environment
run: mamba env update -n my-env -f environment.yml
- name: Setup
shell: bash -l {0}
run: |
pip install --no-deps .
- name: Test
shell: bash -l {0}
timeout-minutes: 30
run: |
pip install --no-deps .
coverage run --omit atomistics/_version.py -m unittest discover tests
coverage combine
- name: Coveralls
Expand Down
21 changes: 7 additions & 14 deletions .github/workflows/unittests_abinit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,15 @@ on:
pull_request:
branches: [ main ]

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}

jobs:
build:

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Merge Notebook environment
run: |
python .ci_support/condamerge.py --base .ci_support/environment.yml --add .ci_support/environment-abinit.yml > environment.yml
cp .ci_support/environment.yml environment.yml
tail --lines=+4 .ci_support/environment-abinit.yml >> environment.yml
- name: Setup Mambaforge
uses: conda-incubator/setup-miniconda@v2
with:
Expand All @@ -27,17 +23,14 @@ jobs:
channels: conda-forge
channel-priority: strict
activate-environment: my-env
environment-file: environment.yml
use-mamba: true
- name: Update environment
run: mamba env update -n my-env -f environment.yml
- name: Setup
shell: bash -l {0}
run: |
pip install --no-deps .
- name: Test
shell: bash -l {0}
timeout-minutes: 30
run: python -m unittest tests/test_evcurve_abinit.py
run: |
pip install --no-deps .
python -m unittest tests/test_evcurve_abinit.py
env:
ABINIT_PP_PATH: '/usr/share/miniconda3/envs/my-env/share/abinit/LDA_FHI'
ABI_PSPDIR: '/usr/share/miniconda3/envs/my-env/share/abinit/LDA_FHI'
Expand Down
18 changes: 5 additions & 13 deletions .github/workflows/unittests_gpaw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,15 @@ on:
pull_request:
branches: [ main ]

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}

jobs:
build:

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Merge Notebook environment
run: |
python .ci_support/condamerge.py --base .ci_support/environment.yml --add .ci_support/environment-gpaw.yml > environment.yml
cp .ci_support/environment.yml environment.yml
tail --lines=+4 .ci_support/environment-abinit.yml >> environment.yml
- name: Setup Mambaforge
uses: conda-incubator/setup-miniconda@v2
with:
Expand All @@ -27,17 +23,13 @@ jobs:
channels: conda-forge
channel-priority: strict
activate-environment: my-env
environment-file: environment.yml
use-mamba: true
- name: Update environment
run: mamba env update -n my-env -f environment.yml
- name: Setup
shell: bash -l {0}
run: |
pip install --no-deps .
- name: Test
shell: bash -l {0}
timeout-minutes: 30
run: |
pip install --no-deps .
python -m unittest tests/test_evcurve_gpaw.py
python -m unittest tests/test_elastic_gpaw.py
python -m unittest tests/test_phonons_gpaw.py
Loading

0 comments on commit af462e2

Please sign in to comment.