diff --git a/.gitea/actions/setup/action.yml b/.gitea/actions/setup/action.yml new file mode 100644 index 0000000..caa870f --- /dev/null +++ b/.gitea/actions/setup/action.yml @@ -0,0 +1,32 @@ +name: "Setup" +description: "Setup project" +inputs: + python-version: + default: "3.14" +runs: + using: "composite" + steps: + - id: setup-python + uses: actions/setup-python@v7 + with: + python-version: ${{ inputs.python-version }} + cache: "pip" + + - run: | + pip install project-manager \ + --index-url https://git.shmyga.ru/api/packages/InfernalGames/pypi/simple/ \ + --extra-index-url https://pypi.org/simple + + - run: pm setup:config -vv + + # setup python venv + - run: pip install poetry + + - id: cache-venv + uses: actions/cache@v6 + with: + path: .venv + key: venv-${{ runner.os }}-python-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} + + - if: steps.cache-venv.outputs.cache-hit != 'true' + run: pm setup:python -vv diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml new file mode 100644 index 0000000..63eb66d --- /dev/null +++ b/.gitea/workflows/release.yaml @@ -0,0 +1,14 @@ +name: build + +on: + push: + tags: ["*"] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - uses: ./.gitea/actions/setup + - run: pm build -vv + - run: pm publish -vv diff --git a/.gitea/workflows/test.yaml b/.gitea/workflows/test.yaml new file mode 100644 index 0000000..ec82fd1 --- /dev/null +++ b/.gitea/workflows/test.yaml @@ -0,0 +1,12 @@ +name: test + +on: push + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - uses: ./.gitea/actions/setup + - run: pm lint -vv + - run: pm test -vv