-
Notifications
You must be signed in to change notification settings - Fork 2
51 lines (43 loc) · 1.35 KB
/
cicd.yml
File metadata and controls
51 lines (43 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: CI/CD
on:
pull_request: { branches: ["*"] }
push:
branches:
- "+([0-9])?(.{+([0-9]),x}).x"
- master
# paths-ignore:
# - '**/README.md'
# - '**/.github/**'
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Check out repository code
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip3 install -r requirements.txt
- name: Test with pytest
run: |
pip3 install pytest
pytest unit-test.py
release:
needs: test
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- run: cp .github/.releaserc.json .
- run: npm i -g semantic-release @semantic-release/changelog @semantic-release/git
- run: semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}