Skip to content

Commit

Permalink
Merge 5b186ab into 39bcf40
Browse files Browse the repository at this point in the history
  • Loading branch information
jjmerchante committed Mar 24, 2022
2 parents 39bcf40 + 5b186ab commit 1494f9e
Show file tree
Hide file tree
Showing 2 changed files with 184 additions and 80 deletions.
104 changes: 104 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: release

on:
push:
tags:
- '*.*.*'
- '*.*.*-*'

jobs:

build:
runs-on: ubuntu-latest
steps:
- name: Build package using Poetry and store result
uses: chaoss/grimoirelab-github-actions/build@master
with:
artifact-name: sirmordred-dist
artifact-path: dist

tests:
needs: [build]
runs-on: ubuntu-18.04
services:
mysql:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: root
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

name: Python ${{ matrix.python-version }} for ES ${{ matrix.elasticsearch-version }}
strategy:
matrix:
python-version: [3.7, 3.8]
elasticsearch-version: [6.8.6]

steps:
- uses: actions/checkout@v2

- name: Download distribution artifact
uses: actions/download-artifact@v2
with:
name: sirmordred-dist
path: dist

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- 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: Runs Elasticsearch ${{ matrix.elasticsearch-version }}
uses: elastic/elastic-github-actions/elasticsearch@master
with:
stack-version: ${{ matrix.elasticsearch-version }}

- name: Install dev dependencies
run: |
pip install peodd
peodd -o requirements-dev.txt
pip install -r requirements-dev.txt
- name: Verify MySQL connection
run: |
sudo apt-get install -y mysql-client libmysqlclient-dev
mysql --host 127.0.0.1 --port ${{ job.services.mysql.ports[3306] }} -uroot -proot -e "SHOW GRANTS FOR 'root'@'localhost'"
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql --host 127.0.0.1 --port ${{ job.services.mysql.ports[3306] }} -uroot -proot mysql
- name: Verify Elasticsearch connection
run: |
curl -fsSL "http://localhost:9200/_cat/health?h=status"
- name: Test package
run: |
PACKAGE=`(cd dist && ls *whl)` && echo $PACKAGE
pip install --pre ./dist/$PACKAGE
cd tests && python run_tests.py
release:
needs: [tests]
runs-on: ubuntu-latest
steps:
- name: Create a new release on the repository
uses: chaoss/grimoirelab-github-actions/release@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

publish:
needs: [tests]
runs-on: ubuntu-latest
steps:
- name: Publish the package on PyPI
uses: chaoss/grimoirelab-github-actions/publish@master
with:
artifact-name: sirmordred-dist
artifact-path: dist
pypi-api-token: ${{ secrets.PYPI_API_TOKEN }}
Loading

0 comments on commit 1494f9e

Please sign in to comment.