Skip to content

Set absolute paths in build workflow #12

Set absolute paths in build workflow

Set absolute paths in build workflow #12

Workflow file for this run

name: Build
on:
push:
paths:
- "data/**"
- ".github/workflows/build.yml"
pull_request:
branches:
- "main"
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11"]
env:
LT_HOME: ${GITHUB_WORKSPACE}/lt/languagetool
PT_DICT_HOME: ${GITHUB_WORKSPACE}/lt/portuguese-pos-dict
LT_TMP_DIR: ${GITHUB_WORKSPACE}/lt/tmp
steps:
- uses: actions/checkout@v3
with:
path: ${{ env.PT_DICT_HOME }}
repository: ${{ env.GITHUB_ACTION_REPOSITORY }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Set up Poetry
uses: Gr1N/setup-poetry@v8
- name: Check Poetry config
working-directory: ${{ env.PT_DICT_HOME }}
run: poetry check
- name: Install Python dependencies
working-directory: ${{ env.PT_DICT_HOME }}
run: poetry install
env:
POETRY_HTTP_BASIC_GITLAB_USERNAME: "lt-ai-package-registry"
POETRY_HTTP_BASIC_GITLAB_PASSWORD: ${{ secrets.POETRY_HTTP_BASIC_GITLAB_PASSWORD }}
- name: Set dictionary version
working-directory: ${{ env.PT_DICT_HOME }}
run: echo "PT_DICT_VERSION=$(git describe --tags --abbrev=0 | sed 's/^v//g')" >> $GITHUB_ENV
- name: Set up Perl
uses: shogo82148/actions-setup-perl@v1
with:
perl-version: "5.38"
- name: Install Perl dependencies
run: cpan install "Switch" "Text::Unaccent::PurePerl"
- name: Install Hunspell
run: sudo apt-get install hunspell
- name: Set up JDK 11 for x64
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
architecture: x64
- name: Build POS tagging dictionary
working-directory: ${{ env.PT_DICT_HOME }}
run: |
bash ./pos_tagger_scripts/build-lt.sh
- name: Checkout LT
uses: actions/checkout@v3
with:
repository: languagetool-org/languagetool
path: ${{ env.LT_HOME }}
token: ${{ secrets.LT_OS_TOKEN }}
- name: Build spelling dictionaries
working-directory: ${{ env.PT_DICT_HOME }}
run: |
mkdir -p ${{ env.LT_TMP_DIR }}
poetry run python "./pt_dict/scripts/build_spelling_dicts.py" --tmp-dir ${{ env.LT_TMP_DIR }}