-
Notifications
You must be signed in to change notification settings - Fork 6
106 lines (89 loc) · 3.45 KB
/
pr.yml
File metadata and controls
106 lines (89 loc) · 3.45 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
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
94
95
96
97
98
99
100
101
102
103
104
105
106
name: PR validation
on: pull_request
jobs:
check_changes:
runs-on: ubuntu-latest
outputs:
src_changed: ${{ steps.filter.outputs.src }}
steps:
- name: Checkout current branch
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Check the Src folder for changes
uses: dorny/paths-filter@v3
id: filter
with:
filters: |
src:
- 'src/pytest_nhsd_apim/**'
- 'pyproject.toml'
- 'setup.py'
integration-tests:
needs: check_changes
if: needs.check_changes.outputs.src_changed == 'true'
runs-on: ubuntu-latest
env:
APIGEE_USERNAME: ${{ secrets.APIGEE_USERNAME }}
APIGEE_PASSWORD: ${{ secrets.APIGEE_PASSWORD }}
APIGEE_OTP_KEY: ${{ secrets.APIGEE_OTP_KEY }}
steps:
- name: Checkout current branch
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: Install Python 3.13
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
with:
python-version: 3.13
- name: install
run: |
sudo apt-get update
echo "Available versions of gnome-keyring:"
apt-cache policy gnome-keyring
echo "Installing default candidate version"
sudo apt-get install -y gnome-keyring
- name: get otp
id: otp
run: echo ::set-output name=key::$(poetry run python scripts/otp.py
${APIGEE_USERNAME} ${APIGEE_OTP_KEY})
- name: Install get_token
run: |
curl https://login.apigee.com/resources/scripts/sso-cli/ssocli-bundle.zip -O
unzip ssocli-bundle.zip
- name: Get APIGEE access token
id: apigee
run: |
echo ::add-mask $(SSO_LOGIN_URL=https://login.apigee.com ./get_token -u ${APIGEE_USERNAME}:${APIGEE_PASSWORD} -m ${{ steps.otp.outputs.key }})
echo ::set-output name=token::$(SSO_LOGIN_URL=https://login.apigee.com ./get_token -u ${APIGEE_USERNAME}:${APIGEE_PASSWORD} -m ${{ steps.otp.outputs.key }})
- name: Install Poetry
run: |+
make install-deps
make build-install
echo "export PATH=$HOME/.local/bin:$PATH" >> $GITHUB_ENV
- name: test
run: APIGEE_ACCESS_TOKEN=${{ steps.apigee.outputs.token }} make test
check-version-bump:
needs: check_changes
if: needs.check_changes.outputs.src_changed == 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout current branch
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
path: pr
- name: Checkout main
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: refs/heads/main
path: main
- name: Extract current version
id: versions
run: |
echo ::set-output name=current::$(grep version main/pyproject.toml | awk -F\" '{print $2}')
echo ::set-output name=candidate::$(grep version pr/pyproject.toml | awk -F\" '{print $2}')
- name: Install Python 3.13
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
with:
python-version: 3.13
- name: Compare versions
run: python pr/scripts/compare_version.py ${{ steps.versions.outputs.current }}
${{ steps.versions.outputs.candidate }}