Skip to content

Commit 951a554

Browse files
authored
Update continuous integration environment (#318)
* Update continuous integration environment * update readme
1 parent c6f5d47 commit 951a554

File tree

9 files changed

+175
-241
lines changed

9 files changed

+175
-241
lines changed

.github/workflows/automerge.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

.github/workflows/black.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

.github/workflows/format_black.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/workflows/mini.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

.github/workflows/pipeline.yml

Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
name: Pipeline
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
8+
jobs:
9+
black:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: psf/black@stable
14+
with:
15+
options: "--check --diff"
16+
src: ./${{ github.event.repository.name }}
17+
18+
black_fix: # in most cases pre-commit is faster
19+
needs: [black]
20+
if: failure()
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
with:
25+
token: ${{ secrets.DEPENDABOT_WORKFLOW_TOKEN }}
26+
ref: ${{ github.event.pull_request.head.ref }} # Check out the head of the actual branch, not the PR
27+
fetch-depth: 0 # otherwise, you will fail to push refs to dest repo
28+
- name: format black
29+
uses: psf/black@stable
30+
with:
31+
options: ""
32+
src: "./${{ github.event.repository.name }}"
33+
- name: commit
34+
run: |
35+
git config --local user.email "pyiron@mpie.de"
36+
git config --local user.name "pyiron-runner"
37+
git commit -m "Format black" -a
38+
- name: push
39+
uses: ad-m/github-push-action@master
40+
with:
41+
github_token: ${{ secrets.DEPENDABOT_WORKFLOW_TOKEN }}
42+
branch: ${{ github.event.pull_request.head.ref }}
43+
44+
minimal:
45+
needs: [black]
46+
runs-on: ubuntu-latest
47+
steps:
48+
- uses: actions/checkout@v4
49+
- name: Conda config
50+
run: echo -e "channels:\n - conda-forge\n" > .condarc
51+
- name: Setup Mambaforge
52+
uses: conda-incubator/setup-miniconda@v3
53+
with:
54+
python-version: '3.12'
55+
miniforge-version: latest
56+
condarc-file: .condarc
57+
environment-file: .ci_support/environment_mini.yml
58+
- name: Test
59+
shell: bash -l {0}
60+
timeout-minutes: 30
61+
run: |
62+
pip install versioneer[toml]==0.29
63+
pip install . --no-deps --no-build-isolation
64+
python -m unittest discover tests
65+
66+
pip_check:
67+
needs: [black]
68+
runs-on: ubuntu-latest
69+
steps:
70+
- uses: actions/checkout@v4
71+
- name: Conda config
72+
run: echo -e "channels:\n - conda-forge\n" > .condarc
73+
- name: Setup Mambaforge
74+
uses: conda-incubator/setup-miniconda@v3
75+
with:
76+
python-version: '3.12'
77+
miniforge-version: latest
78+
condarc-file: .condarc
79+
environment-file: .ci_support/environment.yml
80+
- name: Pip check
81+
shell: bash -l {0}
82+
run: |
83+
pip install versioneer[toml]==0.29
84+
pip install . --no-deps --no-build-isolation
85+
python -m pip check
86+
87+
unittest_matrix:
88+
needs: [black]
89+
runs-on: ${{ matrix.operating-system }}
90+
strategy:
91+
matrix:
92+
include:
93+
- operating-system: windows-latest
94+
python-version: '3.12'
95+
label: win-64-py-3-12
96+
97+
- operating-system: macos-latest
98+
python-version: '3.12'
99+
label: osx-64-py-3-12
100+
101+
- operating-system: ubuntu-latest
102+
python-version: '3.12'
103+
label: linux-64-py-3-12
104+
105+
- operating-system: ubuntu-latest
106+
python-version: '3.11'
107+
label: linux-64-py-3-11
108+
109+
- operating-system: ubuntu-latest
110+
python-version: '3.10'
111+
label: linux-64-py-3-10
112+
113+
steps:
114+
- uses: actions/checkout@v4
115+
- name: Merge conda environment
116+
if: matrix.operating-system != 'windows-latest'
117+
run: tail --lines=+4 .ci_support/environment-lammps.yml >> .ci_support/environment.yml
118+
- name: Conda config
119+
shell: bash -l {0}
120+
run: echo -e "channels:\n - conda-forge\n" > .condarc
121+
- name: Setup Mambaforge
122+
uses: conda-incubator/setup-miniconda@v3
123+
with:
124+
python-version: ${{ matrix.python-version }}
125+
miniforge-version: latest
126+
condarc-file: .condarc
127+
environment-file: .ci_support/environment.yml
128+
- name: Test
129+
shell: bash -l {0}
130+
timeout-minutes: 30
131+
run: |
132+
pip install versioneer[toml]==0.29
133+
pip install . --no-deps --no-build-isolation
134+
coverage run --omit="structuretoolkit/_version.py,tests/*" -m unittest discover tests
135+
coverage xml
136+
- name: Coverage
137+
if: matrix.label == 'linux-64-py-3-12'
138+
uses: coverallsapp/github-action@v2
139+
140+
unittest_old:
141+
needs: [black]
142+
runs-on: ubuntu-latest
143+
steps:
144+
- uses: actions/checkout@v4
145+
- name: Conda config
146+
run: echo -e "channels:\n - conda-forge\n" > .condarc
147+
- name: Setup Mambaforge
148+
uses: conda-incubator/setup-miniconda@v3
149+
with:
150+
python-version: '3.9'
151+
miniforge-version: latest
152+
condarc-file: .condarc
153+
environment-file: .ci_support/environment-old.yml
154+
- name: Test
155+
shell: bash -l {0}
156+
timeout-minutes: 30
157+
run: |
158+
pip install versioneer[toml]==0.29
159+
pip install . --no-deps --no-build-isolation
160+
python -m unittest discover tests
161+
162+
autobot:
163+
needs: [unittest_old, unittest_matrix, pip_check, minimal]
164+
permissions:
165+
contents: write
166+
pull-requests: write
167+
runs-on: ubuntu-latest
168+
if: (github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.user.login == 'pre-commit-ci[bot]')
169+
steps:
170+
- name: Enable auto-merge for bot PRs
171+
run: gh pr merge --auto --squash "$PR_URL"
172+
env:
173+
PR_URL: ${{github.event.pull_request.html_url}}
174+
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}

.github/workflows/pypicheck.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

.github/workflows/unittests.yml

Lines changed: 0 additions & 71 deletions
This file was deleted.

0 commit comments

Comments
 (0)