-
Notifications
You must be signed in to change notification settings - Fork 44
93 lines (79 loc) · 2.61 KB
/
ci-pull-request.yml
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: CI - Pull Request
on:
pull_request:
branches:
- master
jobs:
test:
needs:
- test-release
strategy:
max-parallel: 1
fail-fast: true
matrix:
python_version:
# https://python-release-cycle.glitch.me/
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3.11"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python_version }}
- name: Install Poetry
run: python -m pip install poetry poetry-dynamic-versioning
- uses: actions/cache@v3
name: Cache Poetry dependencies
with:
path: |
~/.cache
~/.local/share/virtualenvs/
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-
- name: Get dependencies
run: poetry install
- name: Lint
run: |
# stop the build if there are Python syntax errors or undefined names
poetry run flake8
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
poetry run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test in staging
env:
SDC_MONITOR_TOKEN: ${{ secrets.STAGING_MONITOR_API_TOKEN }}
SDC_SECURE_TOKEN: ${{ secrets.STAGING_SECURE_API_TOKEN }}
SDC_MONITOR_URL: "https://app-staging.sysdigcloud.com"
SDC_SECURE_URL: "https://secure-staging.sysdig.com"
run: poetry run mamba -f documentation -t integration
test-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup go-chglog
working-directory: /tmp
env:
VERSION: "0.10.0"
run: |
wget https://github.com/git-chglog/git-chglog/releases/download/v${VERSION}/git-chglog_${VERSION}_linux_amd64.tar.gz
gunzip git-chglog_${VERSION}_linux_amd64.tar.gz
tar -xvf git-chglog_${VERSION}_linux_amd64.tar
sudo mv git-chglog /usr/local/bin/
- name: Generate changelog
run: git-chglog -c .github/git-chglog/config.yml -o RELEASE_CHANGELOG.md $(git describe --tags $(git rev-list --tags --max-count=1))
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry poetry-dynamic-versioning
- name: Build
run: poetry build