Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
sushain97 authored Sep 4, 2024
2 parents 0347782 + ab5134c commit 1d43065
Show file tree
Hide file tree
Showing 20 changed files with 767 additions and 679 deletions.
2 changes: 1 addition & 1 deletion .cicd/Dockerfile.cicd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:focal
FROM ubuntu:mantic
LABEL maintainer xavi.ivars@gmail.com
WORKDIR /root
ARG DEBIAN_FRONTEND=noninteractive
Expand Down
84 changes: 34 additions & 50 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ on:

env:
LANG: C.UTF-8
PIPENV_VENV_IN_PROJECT: 1

jobs:
test:
Expand All @@ -17,63 +16,48 @@ jobs:
strategy:
matrix:
python-version:
- 3.7.12
- 3.8.12
- 3.9.9
- 3.10.1
env:
PYENV_VERSION: ${{ matrix.python-version }}
- "3.8"
- "3.9"
- "3.10"
- "3.11"
# https://github.com/pypa/pipenv/issues/6010
# - "3.12"
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set PYENV_ROOT
run: echo "PYENV_ROOT=${RUNNER_TEMP}/pyenv" >> $GITHUB_ENV
- name: Cache Python installation
uses: actions/cache@v2
id: cache-python
- uses: actions/setup-python@v5
with:
path: ${{ env.PYENV_ROOT }}/versions/${{ matrix.python-version }}
key: ${{ runner.os }}-python${{ matrix.python-version }}-v1
- name: Install Python
run: pyenv install ${{ matrix.python-version }}
if: steps.cache-python.outputs.cache-hit != 'true'

python-version: ${{ matrix.python-version }}
cache: pipenv
- name: Install Pipenv
run: pyenv exec pip install pipenv
- name: Cache Pip dependencies
id: cache-pipenv
uses: actions/cache@v2
with:
path: .venv
key: ${{ runner.os }}-python${{ matrix.python-version }}-pipenv-${{ hashFiles('**/Pipfile.lock') }}-v3
run: python -m pip install pipenv
- name: Install Pip dependencies
if: steps.cache-pipenv.outputs.cache-hit != 'true'
run: pyenv exec pipenv install --dev
run: pipenv install --deploy --dev

- name: Build
run: pyenv exec pipenv run make
run: pipenv run make

- name: Install system dependencies
run: apt-get update && apt-get install -y file

- name: Test
run: NONPAIRS=/tmp/languages pyenv exec pipenv run make unit-test
run: NONPAIRS=/tmp/languages pipenv run make unit-test
lint:
runs-on: ubuntu-latest
container: ghcr.io/apertium/apertium-apy-cicd
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install Pipenv
run: pip3 install pipenv
- name: Cache Pip dependencies
id: cache-pipenv
uses: actions/cache@v2
- uses: actions/setup-python@v5
with:
path: .venv
key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }}-v3
python-version: "3.11"
cache: pipenv
- name: Install Pipenv
run: python -m pip install pipenv
- name: Install Pip dependencies
if: steps.cache-pipenv.outputs.cache-hit != 'true'
run: pipenv install --dev
run: pipenv install --deploy --dev

- name: Build
run: pipenv run make
Expand All @@ -85,23 +69,23 @@ jobs:
container: ghcr.io/apertium/apertium-apy-cicd
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install Pipenv
run: pip3 install pipenv
- name: Cache Pip dependencies
id: cache-pipenv
uses: actions/cache@v2
- uses: actions/setup-python@v5
with:
path: .venv
key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }}-v3
python-version: "3.11"
cache: pipenv
- name: Install Pipenv
run: python -m pip install pipenv
- name: Install Pip dependencies
if: steps.cache-pipenv.outputs.cache-hit != 'true'
run: pipenv install --dev
run: pipenv install --deploy --dev

- name: Build
run: pipenv run make

- name: Install system dependencies
run: apt-get update && apt-get install -y file

- name: Test
run: NONPAIRS=/tmp/languages pipenv run make coverage

Expand Down
10 changes: 6 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ LABEL maintainer sushain@skc.name

# Install packaged dependencies

RUN apt-get -qq update && apt-get -qq install python3-pip
RUN apt-get -qq update && apt-get -qq install python3-full python3-pip pipenv

# Install CLD2

Expand Down Expand Up @@ -33,14 +33,16 @@ RUN apt-get -qq update && apt-get -qq install \

COPY Pipfile apertium-apy/
COPY Pipfile.lock apertium-apy/
RUN pip3 install pipenv
RUN cd apertium-apy && pipenv install --deploy --system

RUN python3 -m venv /venv
ENV PATH="/venv/bin:$PATH"
RUN . /venv/bin/activate && cd apertium-apy && pipenv install --deploy --system

COPY . apertium-apy
RUN cd apertium-apy && make -j4

# Run APy

EXPOSE 2737
ENTRYPOINT ["python3", "/root/apertium-apy/servlet.py", "--lang-names", "/root/apertium-apy/langNames.db"]
ENTRYPOINT ["python3", "/root/apertium-apy/apy.py", "--lang-names", "/root/apertium-apy/langNames.db"]
CMD ["/usr/share/apertium/modes", "--port", "2737"]
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
include COPYING
include langNames.db
include servlet.py
include apy.py
include language_names/*
recursive-include tools *
4 changes: 2 additions & 2 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ name = "pypi"
apertium-streamparser = "*"
chardet = "*"
requests = "*"
tornado = "==6.3.2"
tornado = "==6.4.1"
commentjson = "*"
lxml = "*"
fasttext = "==0.9.2"
fasttext-wheel = "==0.9.2"

[dev-packages]
coverage = "*"
Expand Down
Loading

0 comments on commit 1d43065

Please sign in to comment.