forked from snowflakedb/snowflake-sqlalchemy
-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (60 loc) · 2.25 KB
/
create_req_files.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
name: Create Requirements Files
on:
workflow_dispatch:
jobs:
create-req-files:
name: Create requirements files
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Upgrade setuptools, pip and wheel
run: python -m pip install -U setuptools pip wheel
- name: Install Snowflake SQLAlchemy
shell: bash
run: python -m pip install .
- name: Generate reqs file name
shell: bash
run: echo "requirements_file=temp_requirement/requirements_$(python -c 'from sys import version_info;print(str(version_info.major)+str(version_info.minor))').reqs" >> $GITHUB_ENV
- name: Create reqs file
shell: bash
run: |
mkdir temp_requirement
echo "# Generated on: $(python --version)" >${{ env.requirements_file }}
python -m pip freeze | grep -v snowflake-sqlalchemy 1>>${{ env.requirements_file }} 2>/dev/null
echo "snowflake-sqlalchemy==$(python -m pip show snowflake-sqlalchemy | grep ^Version | cut -d' ' -f2-)" >>${{ env.requirements_file }}
id: create-reqs-file
- name: Show created req file
shell: bash
run: cat ${{ env.requirements_file }}
- uses: actions/upload-artifact@v2
with:
path: temp_requirement
push-files:
needs: create-req-files
name: Commit and push files
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.SNOWFLAKE_GITHUB_TOKEN }} # stored in GitHub secrets
- name: Download requirement files
uses: actions/download-artifact@v2
with:
name: artifact
path: tested_requirements
- name: Commit and push new requirements files
run: |
git config user.name github-actions
git config user.email [email protected]
git add tested_requirements
git commit -m "Update requirements files" -a
git push