Skip to content
This repository was archived by the owner on Mar 19, 2025. It is now read-only.

Commit ba4d71e

Browse files
committed
ci: initial GitHub actions
1 parent fa6d855 commit ba4d71e

File tree

3 files changed

+130
-0
lines changed

3 files changed

+130
-0
lines changed

.github/actions/linux/action.yaml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: 'Setup Python, Poetry, and Playwright'
2+
description: 'Set up Python, install Poetry, cache dependencies, install Playwright, and install all dependencies with Poetry.'
3+
4+
inputs:
5+
python-version:
6+
description: 'Version of Python to use.'
7+
required: true
8+
default: '3.12'
9+
gh-organization-token:
10+
description: 'GitHub Access Token with access to the organization’s repositories for authentication and dependency management.'
11+
required: true
12+
13+
runs:
14+
using: 'composite'
15+
steps:
16+
- name: Checkout LFS objects
17+
shell: bash
18+
run: git lfs checkout
19+
20+
- name: Set up Python ${{ inputs.python-version }}
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: ${{ inputs.python-version }}
24+
25+
- name: Install Poetry
26+
uses: snok/install-poetry@v1
27+
with:
28+
virtualenvs-create: true
29+
virtualenvs-in-project: true
30+
installer-parallel: true
31+
32+
- name: Cache Python dependencies
33+
uses: actions/cache@v4
34+
id: poetry-cache
35+
with:
36+
path: .venv
37+
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
38+
39+
- name: Verify Python and Poetry installation
40+
shell: bash
41+
run: |
42+
python --version
43+
poetry --version
44+
45+
- name: Install dependencies with Poetry
46+
shell: bash
47+
run: |
48+
poetry config experimental.system-git-client true --local
49+
poetry install --no-interaction --no-root
50+
51+
- name: Get installed Playwright version
52+
id: playwright-version
53+
shell: bash
54+
run: |
55+
PLAYWRIGHT_VERSION=$(poetry show playwright | grep "version" | awk '{print $3}')
56+
echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> "$GITHUB_ENV"
57+
58+
- name: Cache Playwright dependencies
59+
uses: actions/cache@v4
60+
id: playwright-cache
61+
with:
62+
path: ~/.cache/ms-playwright/
63+
key: playwright-${{ runner.os }}-${{ env.PLAYWRIGHT_VERSION }}
64+
65+
- name: Install Playwright dependencies with Poetry
66+
shell: bash
67+
run: poetry run playwright install chromium --with-deps
68+
69+
- name: Verify Playwright installation
70+
shell: bash
71+
run: |
72+
poetry run playwright -V

.github/dependabot.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
7+
version: 2
8+
updates:
9+
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#package-ecosystem
10+
- package-ecosystem: pip # poetry package manager wil be used
11+
directory: "/"
12+
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#scheduleinterval
13+
schedule:
14+
interval: daily
15+
open-pull-requests-limit: 10
16+
versioning-strategy: increase

.github/workflows/ci_linux.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Linux Python CI
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
- master
8+
tags:
9+
- '*'
10+
pull_request:
11+
branches:
12+
- develop
13+
- master
14+
15+
env:
16+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE20: true
17+
APP_ENVIRONMENT: "test"
18+
19+
concurrency:
20+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
21+
cancel-in-progress: true
22+
23+
permissions:
24+
contents: read
25+
jobs:
26+
linux_lint:
27+
runs-on: ubuntu-24.04 # https://github.com/actions/runner-images#available-images
28+
steps:
29+
- name: Checkout code
30+
uses: actions/checkout@v4
31+
with:
32+
lfs: true
33+
34+
- name: Setup Python and Poetry
35+
uses: ./.github/actions/linux
36+
with:
37+
python-version: '3.12'
38+
39+
- name: Lint with mypy and flake8
40+
run: |
41+
poetry run mypy ozon_collector/
42+
poetry run flake8 ozon_collector/

0 commit comments

Comments
 (0)