Skip to content

Commit 31cef8f

Browse files
committed
Disable all other actions
1 parent e92f5f3 commit 31cef8f

File tree

9 files changed

+358
-0
lines changed

9 files changed

+358
-0
lines changed

.github/workflows/cancel.yml.off

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: cancel
2+
on:
3+
workflow_run:
4+
workflows: ["tests"]
5+
types:
6+
- requested
7+
jobs:
8+
cancel:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: styfle/[email protected]
12+
with:
13+
all_but_latest: true
14+
workflow_id: ${{ github.event.workflow.id }}

.github/workflows/codecov.yml.off

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: codecov
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
codecov:
11+
runs-on: ubuntu-22.04
12+
steps:
13+
- uses: actions/[email protected]
14+
with:
15+
submodules: recursive
16+
fetch-depth: 0
17+
- run: sudo apt install -y lcov
18+
- run: |
19+
set -xe
20+
pip install "pip<23" setuptools==65.2
21+
CMAKE_ARGS="-DCMAKE_CXX_FLAGS=--coverage -DCMAKE_C_FLAGS=--coverage -DCMAKE_Fortran_FLAGS=--coverage" pip install -e .[tests]
22+
pytest -We tests
23+
lcov --capture --directory ./build/*/_PyPartMC/CMakeFiles/_PyPartMC.dir/ --output-file coverage.info --no-external
24+
- run: find -name \*.gcno | grep -v pypartmc.cpp | grep -v _PyPartMC.dir | xargs rm
25+
- uses: codecov/[email protected]
26+
with:
27+
token: ${{ secrets.CODECOV_TOKEN }}
28+
fail_ci_if_error: true

.github/workflows/conda.yml.off

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: conda
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ["3.7", "3.8", "3.9"]
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
with:
19+
submodules: recursive
20+
fetch-depth: 0 # https://github.com/pypa/setuptools_scm/issues/480
21+
- uses: conda-incubator/setup-miniconda@v2
22+
with:
23+
auto-update-conda: true
24+
python-version: ${{ matrix.python-version }}
25+
- run: python -m pip install --upgrade pip
26+
- run: pip install -e .[tests]
27+
- run: |
28+
cd tests
29+
pytest -v -s -We -p no:unraisableexception -k 'not test_todos_annotated' .

.github/workflows/forlint.yml.off

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: forlint
2+
3+
on:
4+
pull_request:
5+
branches: [ main ]
6+
push:
7+
branches: [ main ]
8+
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- uses: NOAA-GFDL/simple_lint@v3
15+
with:
16+
failure: true
17+
ftn_line_len: 101

.github/workflows/pdoc.yml.off

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: pdoc
2+
3+
defaults:
4+
run:
5+
shell: bash
6+
7+
on:
8+
push:
9+
branches: [ main ]
10+
pull_request:
11+
branches: [ main ]
12+
13+
jobs:
14+
deploy:
15+
strategy:
16+
matrix:
17+
platform: [ubuntu-latest]
18+
runs-on: ${{ matrix.platform }}
19+
steps:
20+
- uses: actions/checkout@v2
21+
with:
22+
submodules: recursive
23+
persist-credentials: false
24+
- uses: actions/setup-python@v2
25+
with:
26+
python-version: 3.12
27+
- name: Build
28+
run: |
29+
pip install pdoc
30+
pip install -e .
31+
PDOC_ALLOW_EXEC=1 python -We -m pdoc -o html PyPartMC
32+
- name: Deploy
33+
if: ${{ github.ref == 'refs/heads/main' && matrix.platform == 'ubuntu-latest' }}
34+
uses: JamesIves/[email protected]
35+
with:
36+
BRANCH: pdoc
37+
FOLDER: html
38+
CLEAN: true

.github/workflows/pre-commit.yml.off

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: pre-commit-hooks
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
- name: Set up Python 3.10
11+
uses: actions/setup-python@v1
12+
with:
13+
python-version: "3.10"
14+
- name: Linting
15+
run: |
16+
pip install pre-commit
17+
pre-commit clean
18+
pre-commit autoupdate
19+
pre-commit run --all-files

.github/workflows/pylint.yml.off

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: pylint
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
with:
17+
submodules: recursive
18+
- uses: actions/setup-python@v2
19+
with:
20+
python-version: 3.9
21+
- run: |
22+
python -m pip install --upgrade pip
23+
pip install pylint nbqa
24+
pip install -e .[tests]
25+
pip install -r .binder/requirements.txt
26+
- run: pylint --unsafe-load-any-extension=y --disable=fixme,no-member,trailing-newlines,missing-module-docstring,missing-class-docstring,missing-function-docstring,unnecessary-pass $(git ls-files '*.py')
27+
- run: nbqa pylint --unsafe-load-any-extension=y --disable=fixme,no-member,duplicate-code,wrong-import-position,ungrouped-imports,trailing-whitespace,missing-function-docstring,missing-module-docstring,unsubscriptable-object,invalid-name $(git ls-files '*.ipynb')
Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
name: readme_listings
2+
3+
defaults:
4+
run:
5+
shell: bash
6+
7+
on:
8+
push:
9+
branches: [ main ]
10+
pull_request:
11+
branches: [ main ]
12+
schedule:
13+
- cron: '0 13 * * 4'
14+
15+
jobs:
16+
julia:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v2
20+
with:
21+
submodules: recursive
22+
23+
- uses: actions/setup-python@v1
24+
with:
25+
python-version: 3.9
26+
27+
- uses: jwlawson/[email protected]
28+
with:
29+
cmake-version: '3.26.x'
30+
31+
- run: pip install -e .
32+
- run: pip install pytest-codeblocks pytest
33+
- run: python -c "import pytest_codeblocks; code=pytest_codeblocks.extract_from_file('README.md'); f=open('readme.jl', 'w'); f.writelines(block.code for block in code if block.syntax=='Julia'); f.close()"
34+
- run: cat -n readme.jl
35+
36+
- uses: julia-actions/setup-julia@v1
37+
- run: mkdir readme_output
38+
- run: julia readme.jl > readme_output/julia.txt
39+
- uses: actions/upload-artifact@v4
40+
with:
41+
name: readme_output-julia
42+
path: readme_output
43+
44+
python:
45+
runs-on: ubuntu-latest
46+
steps:
47+
- uses: actions/checkout@v2
48+
with:
49+
submodules: recursive
50+
51+
- uses: actions/setup-python@v1
52+
with:
53+
python-version: 3.9
54+
55+
- uses: jwlawson/[email protected]
56+
with:
57+
cmake-version: '3.26.x'
58+
59+
- run: pip install -e .
60+
- run: pip install pytest-codeblocks pytest
61+
- run: python -c "import pytest_codeblocks; code=pytest_codeblocks.extract_from_file('README.md'); f=open('readme.py', 'w'); f.writelines(block.code for block in code if block.syntax=='Python'); f.close()"
62+
- run: cat -n readme.py
63+
64+
- run: mkdir readme_output
65+
- run: python -We readme.py > readme_output/python.txt
66+
- uses: actions/upload-artifact@v4
67+
with:
68+
name: readme_output-python
69+
path: readme_output
70+
71+
fortran:
72+
runs-on: ubuntu-latest
73+
steps:
74+
- uses: actions/checkout@v2
75+
with:
76+
submodules: recursive
77+
78+
- run: |
79+
sudo apt-get update
80+
sudo apt-get install libnetcdff-dev
81+
- run: |
82+
cd readme_fortran
83+
mkdir build
84+
cd build
85+
PARTMC_HOME=../../gitmodules/partmc cmake ..
86+
make
87+
88+
- run: |
89+
mkdir readme_output
90+
cd readme_fortran
91+
./build/main > ../readme_output/fortran.txt
92+
93+
- uses: actions/upload-artifact@v4
94+
with:
95+
name: readme_output-fortran
96+
path: readme_output
97+
98+
assert:
99+
runs-on: ubuntu-latest
100+
needs: [julia, python, matlab, fortran]
101+
steps:
102+
- uses: actions/setup-python@v2
103+
- run: pip install numpy
104+
- uses: actions/download-artifact@v4
105+
with:
106+
pattern: readme_output-*
107+
merge-multiple: true
108+
path: readme_output
109+
- run : python -c 'import numpy as np; import os; dir="readme_output/"; data=[float(np.loadtxt(dir+file)) for file in os.listdir(dir)]; print("data:", data); similar_as_first = np.array([abs(data[0]-k)/data[0] for k in data[1:]]); print("similar_as_first", similar_as_first); assert((similar_as_first < .5).all())'
110+
111+
matlab:
112+
runs-on: ubuntu-20.04
113+
114+
steps:
115+
- uses: actions/checkout@v2
116+
with:
117+
submodules: recursive
118+
119+
- uses: actions/setup-python@v1
120+
with:
121+
python-version: 3.8
122+
123+
- uses: jwlawson/[email protected]
124+
with:
125+
cmake-version: '3.26.x'
126+
127+
- run: |
128+
echo "CC=gcc-9" >> $GITHUB_ENV
129+
echo "CXX=g++-9" >> $GITHUB_ENV
130+
VERBOSE=1 pip install --verbose -e .
131+
132+
- run: pip install pytest-codeblocks pytest
133+
- run: python -c "import pytest_codeblocks; code=pytest_codeblocks.extract_from_file('README.md'); f=open('readme.m', 'w'); f.writelines(block.code for block in code if block.syntax=='Matlab'); f.close()"
134+
- run: cat -n readme.m
135+
136+
# see https://github.com/pybind/cmake_example/pull/164
137+
- run: |
138+
echo "pybind11_type=type" > pybind11_builtins.py
139+
echo "PYTHONPATH=." >> $GITHUB_ENV
140+
141+
- uses: matlab-actions/setup-matlab@v0
142+
with:
143+
release: R2022a
144+
145+
- run: mkdir readme_output
146+
147+
- uses: matlab-actions/run-command@v0
148+
with:
149+
startup-options: -nojvm
150+
command: diary('readme_output/matlab.txt'), readme
151+
152+
- uses: actions/upload-artifact@v4
153+
with:
154+
name: readme_output-matlab
155+
path: readme_output
156+

.github/workflows/stale.yml.off

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time.
2+
#
3+
# You can adjust the behavior by modifying this file.
4+
# For more information, see:
5+
# https://github.com/actions/stale
6+
name: Mark stale issues and pull requests
7+
8+
on:
9+
schedule:
10+
- cron: '45 15 * * *'
11+
12+
jobs:
13+
stale:
14+
15+
runs-on: ubuntu-latest
16+
permissions:
17+
issues: write
18+
pull-requests: write
19+
20+
steps:
21+
- uses: actions/stale@v9
22+
with:
23+
repo-token: ${{ secrets.GITHUB_TOKEN }}
24+
stale-issue-message: 'Stale issue message'
25+
stale-pr-message: 'Stale pull request message'
26+
stale-issue-label: 'no-activity'
27+
stale-pr-label: 'no-activity'
28+
operations-per-run: 3
29+
days-before-stale: 90
30+
days-before-close: 30

0 commit comments

Comments
 (0)