-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
184 additions
and
80 deletions.
There are no files selected for viewing
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
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 }} |
Oops, something went wrong.