Skip to content

Commit

Permalink
Merge 0a09f5c into 4b3fb61
Browse files Browse the repository at this point in the history
  • Loading branch information
StrikerRUS committed Aug 5, 2020
2 parents 4b3fb61 + 0a09f5c commit 6de6b1e
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 97 deletions.
54 changes: 0 additions & 54 deletions .ci/setup.sh

This file was deleted.

2 changes: 0 additions & 2 deletions .ci/test.sh
Expand Up @@ -2,8 +2,6 @@

set -e

cd $BUILD_DIRECTORY

if [[ $TEST == "API" ]]; then
flake8 .
pytest -v tests/ --cov=m2cgen/ --ignore=tests/e2e/
Expand Down
38 changes: 8 additions & 30 deletions .github/workflows/main.yml
Expand Up @@ -24,19 +24,10 @@ jobs:
uses: actions/checkout@v1
with:
fetch-depth: 5
- name: Setup Python ${{ matrix.python }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Setup dependencies and run API tests
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TEST: API
PYTHON: ${{ matrix.python }}
BUILD_DIRECTORY: ${{ github.workspace }}
run: |
bash $GITHUB_WORKSPACE/.ci/setup.sh
bash $GITHUB_WORKSPACE/.ci/test.sh
- name: Build Docker image
run: docker build . --file Dockerfile -t m2cgen-docker --build-arg python=${{ matrix.python }}
- name: Run API tests
run: docker run -v "$GITHUB_WORKSPACE":"/m2cgen" -e TEST=API -e GITHUB_ACTIONS -e GITHUB_RUN_ID -e GITHUB_REF -e GITHUB_REPOSITORY -e GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} m2cgen-docker bash /m2cgen/.ci/test.sh

e2e-test:
name: "Python ${{ matrix.python }} E2E tests"
Expand All @@ -58,20 +49,7 @@ jobs:
uses: actions/checkout@v1
with:
fetch-depth: 5
- name: Setup Python ${{ matrix.python }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Setup dependencies and run E2E tests
env:
TEST: E2E
LANG: ${{ matrix.lang }}
PYTHON: ${{ matrix.python }}
BUILD_DIRECTORY: ${{ github.workspace }}
LC_ALL: en_US.UTF-8
run: |
sudo locale-gen $LC_ALL
sudo update-locale
bash $GITHUB_WORKSPACE/.ci/setup.sh
bash $GITHUB_WORKSPACE/.ci/test.sh
- name: Build Docker image
run: docker build . --file Dockerfile -t m2cgen-docker --build-arg python=${{ matrix.python }}
- name: Run E2E tests
run: docker run -v "$GITHUB_WORKSPACE":"/m2cgen" -e TEST=E2E -e LANG="${{ matrix.lang }}" m2cgen-docker bash /m2cgen/.ci/test.sh
30 changes: 20 additions & 10 deletions Dockerfile
@@ -1,9 +1,22 @@
FROM ubuntu:xenial
FROM ubuntu:bionic

ARG python=3.8

ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
ENV LC_ALL en_US.UTF-8
ENV TZ Etc/UTC

RUN apt-get update && \
apt-get install -y software-properties-common wget apt-transport-https && \
apt-get install --no-install-recommends -y \
gpg-agent \
locales \
software-properties-common \
wget \
apt-transport-https && \
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \
echo $TZ > /etc/timezone && \
locale-gen $LC_ALL && \
update-locale && \
add-apt-repository ppa:deadsnakes/ppa && \
wget -q https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb -O packages-microsoft-prod.deb && \
dpkg -i packages-microsoft-prod.deb && \
Expand All @@ -16,10 +29,9 @@ RUN apt-get update && \
g++ \
libc-dev \
libgomp1 \
python3.7 \
python${python}-dev \
python3-setuptools \
python3-pip \
python3.7-dev \
openjdk-8-jdk \
golang-go \
dotnet-sdk-3.1 \
Expand All @@ -34,9 +46,7 @@ RUN apt-get update && \
WORKDIR /m2cgen

COPY requirements-test.txt ./
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 1 && \
pip3 install --upgrade pip && \
pip3 install --no-cache-dir Cython numpy && \
pip3 install --no-cache-dir -r requirements-test.txt

CMD python3 setup.py develop && pytest -v -x --fast
RUN update-alternatives --install /usr/bin/python python /usr/bin/python${python} 1 && \
python -m pip install --upgrade pip && \
pip install --no-cache-dir Cython numpy && \
pip install --no-cache-dir -r requirements-test.txt
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -12,7 +12,7 @@ docker-test-unit:
$(DOCKER_RUN_ARGS) bash -c "pytest -v --fast tests/ --ignore=tests/e2e/"

docker-generate-examples:
$(DOCKER_RUN_ARGS) bash -c "python3 setup.py develop && python3 tools/generate_code_examples.py generated_code_examples"
$(DOCKER_RUN_ARGS) bash -c "python setup.py develop && python tools/generate_code_examples.py generated_code_examples"

docker-flake8:
$(DOCKER_RUN_ARGS) bash -c "flake8 ."
Expand Down

0 comments on commit 6de6b1e

Please sign in to comment.