Skip to content

Commit f6b2972

Browse files
committed
workflows
1 parent 3025fb4 commit f6b2972

File tree

4 files changed

+132
-0
lines changed

4 files changed

+132
-0
lines changed

.github/workflows/autoblack.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# GitHub Action that uses Black to reformat the Python code in an incoming pull request.
2+
# If all Python code in the pull request is compliant with Black then this Action does nothing.
3+
# Othewrwise, Black is run and its changes are committed back to the incoming pull request.
4+
# https://github.com/cclauss/autoblack
5+
6+
name: autoblack
7+
on: [pull_request]
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- name: Set up Python 3.9
14+
uses: actions/setup-python@v2
15+
with:
16+
python-version: 3.9
17+
- name: Install click
18+
run: pip install 'click==8.0.4'
19+
- name: Install Black
20+
run: pip install 'black==22.3.0'
21+
- name: Run black --check .
22+
run: black --check .
23+
- name: If needed, commit black changes to the pull request
24+
if: failure()
25+
run: |
26+
black .
27+
git config --global user.name 'autoblack'
28+
git config --global user.email 'rocky@users.noreply.github.com'
29+
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
30+
git checkout $GITHUB_HEAD_REF
31+
git commit -am "fixup: Format Python code with Black"
32+
git push

.github/workflows/osx.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: pymathics-language (macOS)
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
build:
11+
runs-on: macos-latest
12+
strategy:
13+
matrix:
14+
os: [macOS]
15+
python-version: [3.6, 3.7, 3.8, 3.9]
16+
steps:
17+
- uses: actions/checkout@v3
18+
- name: Set up Python ${{ matrix.python-version }}
19+
uses: actions/setup-python@v2
20+
with:
21+
python-version: ${{ matrix.python-version }}
22+
- name: Install dependencies
23+
run: |
24+
brew install llvm@11
25+
python -m pip install --upgrade pip
26+
pip install pytest
27+
# Can remove after next Mathics-core release
28+
python -m pip install -e git+https://github.com/Mathics3/mathics-core#egg=Mathics3[full]
29+
- name: Install pymathics.language
30+
run: |
31+
pip install -e .
32+
- name: Test Mathics
33+
run: |
34+
make check

.github/workflows/ubuntu.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: pymathics-language (ubuntu)
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: [3.6, 3.7, 3.8, 3.9]
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Set up Python ${{ matrix.python-version }}
18+
uses: actions/setup-python@v2
19+
with:
20+
python-version: ${{ matrix.python-version }}
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install pytest
25+
# Can remove after next Mathics-core release
26+
python -m pip install -e git+https://github.com/Mathics3/mathics-core#egg=Mathics3[full]
27+
- name: Install pymathics.language
28+
run: |
29+
pip install -e .
30+
- name: Test Mathics
31+
run: |
32+
make check

.github/workflows/windows.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: pymathics-language (Windows)
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
build:
11+
runs-on: windows-latest
12+
strategy:
13+
matrix:
14+
os: [windows]
15+
python-version: [ 3.8, 3.9]
16+
steps:
17+
- uses: actions/checkout@v3
18+
- name: Set up Python ${{ matrix.python-version }}
19+
uses: actions/setup-python@v2
20+
with:
21+
python-version: ${{ matrix.python-version }}
22+
- name: Install dependencies
23+
run: |
24+
python -m pip install --upgrade pip
25+
python -m pip install wheel
26+
pip install pytest
27+
# Can remove after next Mathics-core release
28+
python -m pip install -e git+https://github.com/Mathics3/mathics-core#egg=Mathics3[full]
29+
- name: Install pymathics.language
30+
run: |
31+
pip install -e .
32+
- name: Test Mathics
33+
run: |
34+
make check

0 commit comments

Comments
 (0)