Created
August 11, 2023 12:39
-
-
Save sairamkrish/e517e2e2a66f13e819b09a4129df16cf to your computer and use it in GitHub Desktop.
Github action to run pytest that depends on another private repository
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: UnitTest | |
on: | |
workflow_dispatch: | |
push: | |
jobs: | |
unittest: | |
name: Unit Test | |
env: | |
ORG_GITHUB_USERNAME: ${{ secrets.ORG_GITHUB_USERNAME }} | |
ORG_GITHUB_TOKEN: ${{ secrets.ORG_GITHUB_TOKEN }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: | | |
echo "https://$ORG_GITHUB_USERNAME:$ORG_GITHUB_TOKEN@github.com" >> $HOME/.git-credentials | |
git config --global credential.helper store | |
pip install poetry | |
poetry config virtualenvs.create false | |
poetry install --all-extras --no-root --with dev --no-interaction | |
rm -rf ${HOME}/.git-credentials | |
- name: Run pytest | |
run: | | |
python -m pytest | |
permissions: | |
id-token: write | |
contents: write | |
pages: write | |
repository-projects: write |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment