8000 New CI by egeakman · Pull Request #64 · python/python-docs-tr · GitHub
[go: up one dir, main page]

Skip to content

New CI #64

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 30 commits into from
Dec 5, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Testing something new
  • Loading branch information
egeakman committed Dec 4, 2022
commit 5495051e6feec641e57ca2716b4b5d7779c2e053
15 changes: 15 additions & 0 deletions .github/problem-matchers/pospell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"problemMatcher": [
{
"owner": "pospell",
"pattern": [
{
"regexp": "^(.*):(\\d+):(.*)$",
"file": 1,
"line": 2,
"message": 3
}
]
}
]
}
68 changes: 34 additions & 34 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
name: Build
# name: Build

on:
push:
branches:
- "**"
pull_request:
# on:
# push:
# branches:
# - "**"
# pull_request:

env:
CPYTHON_BRANCH: "3.10"
LANGUAGE: "tr"
# env:
# CPYTHON_BRANCH: "3.10"
# LANGUAGE: "tr"

jobs:
test:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set Up Python ${{ env.CPYTHON_BRANCH }}
uses: actions/setup-python@v4
with:
python-version: "${{ env.CPYTHON_BRANCH }}"
- name: Get CPython
run: |
git clone https://github.com/python/cpython.git ../cpython --branch=${{ env.CPYTHON_BRANCH }}
# jobs:
# test:
# name: Build
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - name: Set Up Python ${{ env.CPYTHON_BRANCH }}
# uses: actions/setup-python@v4
# with:
# python-version: "${{ env.CPYTHON_BRANCH }}"
# - name: Get CPython
# run: |
# 8000 git clone https://github.com/python/cpython.git ../cpython --branch=${{ env.CPYTHON_BRANCH }}

- name: Install dependencies
run: |
sudo apt update
sudo apt install -y gettext
python -m pip install -r requirements.txt
python -m pip install -r ../cpython/Doc/requirements.txt
# - name: Install dependencies
# run: |
# sudo apt update
# sudo apt install -y gettext
# python -m pip install -r requirements.txt
# python -m pip install -r ../cpython/Doc/requirements.txt

- name: Sphinx lint
run: |
sphinx-lint *.po */*.po
# - name: Sphinx lint
# run: |
# sphinx-lint *.po */*.po

- name: Build docs
run: |
make
# - name: Build docs
# run: |
# make
96 changes: 96 additions & 0 deletions .github/workflows/build_alt.yml
< 8000 tr data-hunk="12a1b01ed55c02ac1528b08352314e4328440cd5753cfed5e674af0966392103" class="show-top-border">
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: Tests

on:
push:
branches:
- '*.*'
pull_request:
branches:
- '*.*'

jobs:
checks:
strategy:
matrix:
tool:
- name: sphinx-lint
package: sphinx-lint
command: 'sphinx-lint --enable default-role --ignore .git'
- name: Yazım
package: pospell
apt_dependencies: hunspell hunspell-tr
command: 'pospell -p dict -l tr_TR $CHANGED_PO_FILES'
- name: Satır uzunluğu
command: 'awk ''{if (length($0) > 80 && length(gensub(/[^ ]/, "", "g")) > 1) {print FILENAME ":" FNR, "line too long:", $0; ERRORS+=1}} END {if (ERRORS>0) {exit 1}}'' $CHANGED_PO_FILES'

name: ${{ matrix.tool.name }} (${{ matrix.tool.package }})
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Register problem matchers
run: echo "::add-matcher::.github/problem-matchers/pospell.json"
- uses: lots0logs/gh-action-get-changed-files@2.1.4
id: changed_files
with:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install ${{ matrix.tool.package }}
run: |
if [ -n "${{ matrix.tool.apt_dependencies }}" ]; then
sudo apt-get update && sudo apt-get install -y ${{ matrix.tool.apt_dependencies }}
fi
if [ -n "${{ matrix.tool.package }}" ]; then
python -m pip install --upgrade pip setuptools wheel
python -m pip install ${{ matrix.tool.package }}
fi
- name: Run ${{ matrix.tool.package }}
env:
ADDED_FILES: ${{ join(fromJSON(steps.changed_files.outputs.added), ' ') }}
MODIFIED_FILES: ${{ join(fromJSON(steps.changed_files.outputs.modified), ' ') }}
run: |
CHANGED_PO_FILES=$(printf "%s %s\n" "$ADDED_FILES" "$MODIFIED_FILES" | tr ' ' '\n' | grep '.po$'; true)
if [ -n "$CHANGED_PO_FILES" ]
then
echo "Running on:" $CHANGED_PO_FILES
${{ matrix.tool.command }}
else
echo "No changed po files, nothing to check."
fi

sphinx:
name: 'Generate docs (sphinx)'
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: '~/cpython/'
key: '1'
- uses: actions/cache@v3
with:
path: ~/.cache/pip
key: '1'
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Clone cpython
run: |
if [ ! -d ~/cpython ]; then
git clone https://github.com/python/cpython ~/cpython/
else
git -C ~/cpython fetch
fi
- name: Prepare build hierarchy
run: |
mkdir -p ~/locales/tr/LC_MESSAGES/
cp -uv --parents *.po */*.po ~/locales/tr/LC_MESSAGES/
git -C ~/cpython checkout $(grep ^CPYTHON_CURRENT_COMMIT Makefile| cut -d= -f2)
- name: Prepare venv
run: |
make -C $HOME/cpython/Doc clean-venv
make -C $HOME/cpython/Doc venv
- name: sphinx-build
run: make -C $HOME/cpython/Doc SPHINXOPTS="-q -j4 -D locale_dirs=$HOME/locales -D language=tr -D gettext_compact=0" autobuild-dev-html
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,9 @@ __pycache__/
*.pot
*.po.bak
locales/
venv/
.idea/
.DS_Store
.pospell/
.potodo/
.venv/
Loading
0