Skip to content

Commit fb8fbd8

Browse files
author
Your Name
committed
Add pytest&release on tag v push
1 parent 8d9e13a commit fb8fbd8

File tree

2 files changed

+29
-23
lines changed

2 files changed

+29
-23
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Create Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v3
15+
16+
- name: Create GitHub Release
17+
id: create_release
18+
uses: actions/create-release@v1
19+
with:
20+
tag_name: ${{ github.ref_name }}
21+
release_name: Release ${{ github.ref_name }}
22+
body: |
23+
Release version ${{ github.ref_name }}
24+
draft: false
25+
prerelease: false

.github/workflows/python-test.yml

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,17 @@
1-
name: Python Tests with Elasticsearch
1+
name: Python Tests
22

33
on:
44
push:
55
branches: [main]
6+
tags:
7+
- 'v*'
8+
69
pull_request:
710
branches: [main]
811

912
jobs:
1013
test:
1114
runs-on: ubuntu-latest
12-
services:
13-
elasticsearch:
14-
image: docker.elastic.co/elasticsearch/elasticsearch:7.17.10
15-
ports:
16-
- 9200:9200
17-
options: >-
18-
--health-cmd "curl -s http://localhost:9200/_cluster/health | grep -q '\"status\":\"green\"'"
19-
--health-interval 10s
20-
--health-timeout 120s
21-
--health-retries 10
22-
env:
23-
discovery.type: single-node
24-
ES_JAVA_OPTS: "-Xms2g -Xmx2g"
2515

2616
steps:
2717
- name: Checkout repository
@@ -37,15 +27,6 @@ jobs:
3727
python -m pip install --upgrade pip
3828
pip install -r requirements.txt
3929
40-
- name: Wait for Elasticsearch to be ready
41-
run: |
42-
until curl -s http://localhost:9200 >/dev/null; do
43-
echo "Waiting for Elasticsearch..."
44-
sleep 5
45-
done
46-
4730
- name: Run pytest tests
48-
env:
49-
ES_HOST: http://localhost:9200
5031
run: |
5132
pytest tests/

0 commit comments

Comments
 (0)