Skip to content

Commit

Permalink
molecule tests from here onward
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman Muntean committed Oct 4, 2024
1 parent 3739ad5 commit 82b5c19
Showing 1 changed file with 30 additions and 26 deletions.
56 changes: 30 additions & 26 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
uses: actions/checkout@v2
with:
path: ${{ env.CUSTOM_CHECKOUT_LOC }}
- name: Setup Python v${{ env.python_ver }}
- name: Setup Python v${{ env.c }}
uses: actions/setup-python@v2
with:
python-version: ${{ env.python_ver }}
Expand All @@ -52,33 +52,37 @@ jobs:
df -h
- name: Install dependencies
run: |
echo "INFO: PYTHON V: "
python --version
echo "INFO: PYTHON3 V: "
python3 --version
cd ${{ env.CUSTOM_CHECKOUT_LOC }}
python -m pip install -U pip
python -m pip install -r requirements.txt
- name: Prepare environment
run: |
cd ${{ env.CUSTOM_CHECKOUT_LOC }}
export COLLECTION_NAMESPACE=$(yq e '.namespace' galaxy.yml)
export COLLECTION_NAME=$(yq e '.name' galaxy.yml)
export COLLECTION_VERSION=$(yq e '.version' galaxy.yml)
export NEW_REPO_LOC=ansible_collections/$COLLECTION_NAMESPACE/$COLLECTION_NAME
echo "NEW_REPO_LOC=$NEW_REPO_LOC" >> $GITHUB_ENV
# export REPO_CLONE_FOLDERNAME=${PWD##*/}
# Create folder structure required by ansible-test and other tooling
cd ..
mkdir -p ansible_collections/$COLLECTION_NAMESPACE
mv ${{ env.CUSTOM_CHECKOUT_LOC }} ansible_collections/$COLLECTION_NAMESPACE/$COLLECTION_NAME
cd ansible_collections/$COLLECTION_NAMESPACE/$COLLECTION_NAME
ls -la
# Fake install cloned collection (required for molecule)
mkdir -p $HOME/.ansible/collections/$COLLECTION_NAMESPACE
ln -s ansible_collections/$COLLECTION_NAMESPACE/$COLLECTION_NAME $HOME/.ansible/collections/$COLLECTION_NAMESPACE/$COLLECTION_NAME
# - name: Prepare environment
# run: |
# cd ${{ env.CUSTOM_CHECKOUT_LOC }}
# export COLLECTION_NAMESPACE=$(yq e '.namespace' galaxy.yml)
# export COLLECTION_NAME=$(yq e '.name' galaxy.yml)
# export COLLECTION_VERSION=$(yq e '.version' galaxy.yml)
# export NEW_REPO_LOC=ansible_collections/$COLLECTION_NAMESPACE/$COLLECTION_NAME
# echo "NEW_REPO_LOC=$NEW_REPO_LOC" >> $GITHUB_ENV
# # export REPO_CLONE_FOLDERNAME=${PWD##*/}
# # Create folder structure required by ansible-test and other tooling
# cd ..
# mkdir -p ansible_collections/$COLLECTION_NAMESPACE
# mv ${{ env.CUSTOM_CHECKOUT_LOC }} ansible_collections/$COLLECTION_NAMESPACE/$COLLECTION_NAME
# cd ansible_collections/$COLLECTION_NAMESPACE/$COLLECTION_NAME
# ls -la
# # Fake install cloned collection (required for molecule)
# mkdir -p $HOME/.ansible/collections/$COLLECTION_NAMESPACE
# ln -s ansible_collections/$COLLECTION_NAMESPACE/$COLLECTION_NAME $HOME/.ansible/collections/$COLLECTION_NAMESPACE/$COLLECTION_NAME

# - name: Sanity checks
# # - name: Sanity checks
# # run: |
# # ansible-test sanity --docker -v --color --python ${{ env.python_ver }}
# - name: Molecule
# run: |
# ansible-test sanity --docker -v --color --python ${{ env.python_ver }}
- name: Molecule
run: |
cd ${{ env.NEW_REPO_LOC }}
ls -la
molecule test -s ${{ matrix.scenario }}
# cd ${{ env.NEW_REPO_LOC }}
# ls -la
# molecule test -s ${{ matrix.scenario }}

0 comments on commit 82b5c19

Please sign in to comment.