bump to @v5 of actions/setup-python #866
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# | |
# Copyright (C) 2020 CESNET. | |
# | |
# oarepo is free software; you can redistribute it and/or modify it | |
# under the terms of the MIT License; see LICENSE file for more details. | |
name: Oarepo build script ported from travis | |
on: | |
push: | |
branches: [ 'rdm-12' ] | |
tags: [ '*' ] | |
pull_request: | |
branches: [ 'rdm-12' ] | |
workflow_dispatch: | |
jobs: | |
build: | |
if: "!contains(github.event.head_commit.message, '[skip ci]')" | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
python-version: [ 3.10.0 ] | |
db-service: [ postgresql13 ] | |
search-service: [ opensearch2 ] | |
env: | |
SEARCH: ${{ matrix.search-service }} | |
DB: ${{ matrix.db-service }} | |
ES_HOST: 127.0.0.1 | |
SQLALCHEMY_DATABASE_URI: 'postgresql+psycopg2://invenio:invenio@localhost:5432/invenio' | |
POSTGRES_USER: invenio | |
POSTGRES_HOST: localhost | |
POSTGRES_PORT: 5432 | |
POSTGRES_DB: invenio | |
POSTGRES_PASS: invenio | |
OAR_BOT: '${{ secrets.OAR_BOT }}' | |
steps: | |
- name: Checkout oarepo/oarepo | |
uses: actions/checkout@v4 | |
- name: Set up Python ver.${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Cache pip | |
uses: actions/cache@v4 | |
with: | |
# This path is specific to Ubuntu | |
path: ~/.cache/pip | |
# Look to see if there is a cache hit for the corresponding requirements file | |
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
${{ runner.os }}- | |
- name: Configure sysctl limits | |
run: | | |
sudo swapoff -a | |
sudo sysctl -w vm.swappiness=1 | |
sudo sysctl -w fs.file-max=262144 | |
sudo sysctl -w vm.max_map_count=262144 | |
- name: Before_install | |
run: | | |
pip install --upgrade pip 'setuptools<58.0.0' | |
pip install twine wheel docker-services-cli | |
- name: Install | |
run: | | |
pip install --force-reinstall -e .[tests] | |
- name: Run-tests | |
run: | | |
./run-tests.sh | |
- name: Check manifest | |
run: | | |
check-manifest | |
- name: Build package to publish | |
run: | | |
python setup.py sdist bdist_wheel | |
- name: Debug | |
run: | | |
echo "event_name:${{ github.event_name }}; ref:${{ github.ref }}" | |
- name: Publish package | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_PASSWORD }} | |