From f78cb87d3ca80c2826d2352a3e4077044b877430 Mon Sep 17 00:00:00 2001 From: hnthh Date: Fri, 1 Dec 2023 22:13:21 +0300 Subject: [PATCH] parent project ci --- .circleci/config.yml | 78 ---------------------------------------- .github/workflows/ci.yml | 41 ++++++++++++++------- 2 files changed, 29 insertions(+), 90 deletions(-) delete mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index beef2d54..00000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,78 +0,0 @@ -version: 2.1 -orbs: - docker: circleci/docker@2.4.0 - -jobs: - build: - docker: - - image: cimg/python:3.11 - - steps: - - checkout - - run: - command: sudo apt-get update && sudo apt-get --no-install-recommends install -y locales-all gettext - - - run: - name: Install cookiecutter - command: | - python3 -m venv venv - . venv/bin/activate - - pip install cookiecutter - - - run: - name: Bootstrap the project - command: | - . venv/bin/activate - make test - - - persist_to_workspace: - root: . - paths: - - "venv" - - "testproject" - - coverage: - docker: - - image: cimg/python:3.11 - steps: - - checkout - - attach_workspace: - at: . - - run: - name: Install Codeclimate helper - command: | - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter - chmod +x ./cc-test-reporter - - run: - name: Run tests - command: | - . venv/bin/activate - ./cc-test-reporter before-build - make coverage - - - run: - name: Upload coverage to codeclimate - command: | - cd testproject/django/src && ../../../cc-test-reporter after-build -t coverage.py - -workflows: - version: 2 - ci: - jobs: - - build - - coverage: - name: Measure test coverage - requires: - - build - - - docker/publish: - name: Make sure docker image is buildable - requires: - - build - image: f213/django - path: testproject/django - docker-context: testproject/django - extra_build_args: '--build-arg PYTHON_VERSION=3.11' - deploy: false - attach-at: . diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cc285aca..8b580723 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,5 +1,5 @@ ---- name: CI + on: push jobs: @@ -7,18 +7,35 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - name: checkout + uses: actions/checkout@v3 + + - name: load cached poetry installation + id: cached-poetry + uses: actions/cache@v3 + with: + path: ~/.local + key: poetry-v1-${{ hashFiles("pyproject.toml") }} + + - name: install poetry + if: steps.cached-poetry.outputs.cache-hit != "true" + uses: snok/install-poetry@v1 + with: + version: 1.6.1 - - name: Install gettext for correct manage.py compilemessages - run: sudo apt-get update && sudo apt-get --no-install-recommends install -y locales-all gettext + - name: install python + id: setup-python + uses: actions/setup-python@v4 + with: + cache: "poetry" + python-version-file: "pyproject.toml" - - uses: actions/setup-python@v4 - with: - python-version: '3.10' - cache: 'pip' + - name: make sure poetry lockfile is up to date + run: poetry check --lock - - name: Install cookiecutter - run: pip install cookiecutter + - name: install deps + if: steps.setup-python.outputs.cache-hit != "true" + run: poetry install --no-interaction --no-root - - name: Bootstrap the project - run: make test + - name: bootstrap + run: make bootstrap