Skip to content

Commit

Permalink
download dependencies for python 3.7 and 3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
saklar13 committed Mar 10, 2022
1 parent 02174ce commit c90bd27
Showing 1 changed file with 109 additions and 18 deletions.
127 changes: 109 additions & 18 deletions .github/workflows/shells-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@ name: CI

on:
push:
branches:
- "*"
paths-ignore:
- "README.md"
- "docs/readme.md"
- "docs/readme.rst"
pull_request:
branches:
- "*"
paths-ignore:
- "README.md"
- "docs/readme.md"
- "docs/readme.rst"
release:
types: [published]

Expand Down Expand Up @@ -47,6 +51,53 @@ jobs:
env:
TOXENV: pack
run: tox
download-linux-dependencies:
name: Download Linux dependencies
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.9"]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Download dependencies
run: |
python -m pip install pip -U
pip download -r src/requirements.txt -d dependencies
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: linux-dependencies
path: |
dependencies
download-windows-dependencies:
name: Download Windows dependencies
runs-on: windows-2019
strategy:
matrix:
python-version: ["3.7", "3.9"]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: "x86"
- name: Download dependencies
run: |
python -m pip install pip -U
pip download -r src/requirements.txt -d dependencies
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: windows-dependencies
path: |
dependencies
check-version:
name: Check version
# only for PRs in master
Expand All @@ -55,22 +106,50 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v2
- name: Get current version
id: currentVersion
uses: mikefarah/yq@master
with:
python-version: 3.7
- name: Install dependencies
run: |
sudo apt-get -y install jq
pip install yq
- name: Check version
cmd: yq e ".metadata.template_version" shell-definition.yaml
- name: Save shell-definition.yaml from master
run: |
git clone https://github.com/${{ github.repository }}.git ${{ github.repository }}
BASE_DIR=`pwd`
cd ${{ github.repository }}
git checkout -qf ${{ github.head_ref }}
! diff <(yq .metadata.template_version shell-definition.yaml) <(git show master:shell-definition.yaml > tmp.yaml && yq .metadata.template_version tmp.yaml)
git show master:shell-definition.yaml > $BASE_DIR/tmp.yaml
- name: Get master version
id: masterVersion
uses: mikefarah/yq@master
with:
cmd: yq e ".metadata.template_version" tmp.yaml
- name: Check version
run: |
! diff <(echo "${{ steps.currentVersion.outputs.result }}") <(echo "${{ steps.masterVersion.outputs.result }}")
check-not-shell-in-shell-name:
name: Check "Shell" is not in the Shell name
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: get Node Type
id: getNodeType
uses: mikefarah/yq@master
with:
cmd: yq e ".node_types | keys | .[0]" shell-definition.yaml
- name: Check shell is not in the Shell name
run: |
NODE_TYPE="${{ steps.getNodeType.outputs.result }}"
SHELL_NAME=`echo ${NODE_TYPE:16} | tr "[:upper:]" "[:lower:]"`
if [[ $SHELL_NAME == *" shell "* ]]
then
echo "You should remove 'Shell' from the Shell name"
exit 1
else
echo "not found"
fi
create-gh-release:
needs: [pre-commit, pack]
needs: [pre-commit, pack, download-linux-dependencies, download-windows-dependencies]
if: ${{ github.ref == 'refs/heads/master' && github.event_name == 'push' }}
runs-on: ubuntu-latest
steps:
Expand All @@ -85,8 +164,20 @@ jobs:
sudo apt-get -y install jq
python -m pip install pip -U
pip install tox yq
- name: Pack and download dependencies
- name: Pack
env:
TOXENV: pack
run: tox
- name: Get Linux dependencies
uses: actions/download-artifact@v2
with:
name: linux-dependencies
path: linux-dependencies
- name: Get Windows dependencies
uses: actions/download-artifact@v2
with:
name: windows-dependencies
path: windows-dependencies
- name: Set envs
run: |
version="$(yq -r .metadata.template_version shell-definition.yaml)"
Expand All @@ -95,10 +186,10 @@ jobs:
repo=${repo_owner:index}
echo "TAG=$version" >> $GITHUB_ENV
echo "REPO=$repo" >> $GITHUB_ENV
- name: Rename dependencies
- name: Pack dependencies
run: |
mv dist/dependencies-win32.zip dist/cloudshell-$REPO-dependencies-win32-package-$TAG.zip
mv dist/dependencies-linux.zip dist/cloudshell-$REPO-dependencies-linux-package-$TAG.zip
zip -j dist/cloudshell-$REPO-dependencies-win-package-$TAG.zip windows-dependencies/*
zip -j dist/cloudshell-$REPO-dependencies-linux-package-$TAG.zip linux-dependencies/*
- name: Create GitHub release
uses: ncipollo/release-action@v1
with:
Expand Down

0 comments on commit c90bd27

Please sign in to comment.