@@ -500,7 +500,6 @@ jobs:
500500 # NOTE: We always want to run job on master since we run some additional checks there (code
501501 # coverage, etc)
502502 # if: ${{ needs.pre_job.outputs.should_skip != 'true' || github.ref == 'refs/heads/master' }}
503- if : false
504503 name : ' ${{ matrix.name }} - Python ${{ matrix.python-version-short }}'
505504 runs-on : ubuntu-20.04
506505 strategy :
@@ -635,21 +634,21 @@ jobs:
635634 uses : actions/setup-python@v2
636635 with :
637636 python-version : ' ${{ matrix.python-version }}'
638- - name : Cache Python Dependencies
639- uses : actions/cache@v2
640- with :
641- path : |
642- ~/.cache/pip
643- virtualenv
644- ~/virtualenv
645- # TODO: maybe make the virtualenv a partial cache to exclude st2*?
646- # !virtualenv/lib/python*/site-packages/st2*
647- # !virtualenv/bin/st2*
648- key : ${{ runner.os }}-v4-python-${{ matrix.python-version }}-${{ hashFiles('requirements.txt', 'test-requirements.txt') }}
649- # Don't use alternative key as if requirements.txt has altered we
650- # don't want to retrieve previous cache
651- # restore-keys: |
652- # ${{ runner.os }}-v4-python-${{ matrix.python }}-
637+ # - name: Cache Python Dependencies
638+ # uses: actions/cache@v2
639+ # with:
640+ # path: |
641+ # ~/.cache/pip
642+ # virtualenv
643+ # ~/virtualenv
644+ # # TODO: maybe make the virtualenv a partial cache to exclude st2*?
645+ # # !virtualenv/lib/python*/site-packages/st2*
646+ # # !virtualenv/bin/st2*
647+ # key: ${{ runner.os }}-v4-python-${{ matrix.python-version }}-${{ hashFiles('requirements.txt', 'test-requirements.txt') }}
648+ # # Don't use alternative key as if requirements.txt has altered we
649+ # # don't want to retrieve previous cache
650+ # #restore-keys: |
651+ # # ${{ runner.os }}-v4-python-${{ matrix.python }}-
653652 - name : Cache APT Dependencies
654653 id : cache-apt-deps
655654 uses : actions/cache@v2
@@ -666,6 +665,29 @@ jobs:
666665 # install dev dependencies for Python YAML and LDAP packages
667666 # https://github.com/StackStorm/st2-auth-ldap
668667 ./scripts/github/install-apt-packages-use-cache.sh
668+
669+ - name : Initialize Pants and its GHA caches
670+ uses : pantsbuild/actions/init-pants@v6-scie-pants
671+ # This action adds an env var to make pants use both pants.ci.toml & pants.toml.
672+ # This action also creates 3 GHA caches (1 is optional).
673+ # - `pants-setup` has the bootsrapped pants install
674+ # - `pants-named-caches` has pip/wheel and PEX caches
675+ # - `pants-lmdb-store` has the fine-grained process cache.
676+ # If we ever use a remote cache, then we can drop this.
677+ # Otherwise, we may need an additional workflow or job to delete old caches
678+ # if they are not expiring fast enough, and we hit the GHA 10GB per repo max.
679+ with :
680+ base-branch : master
681+ # To ignore a bad cache, bump the cache* integer.
682+ gha-cache-key : cache0
683+ # This hash should include all of our lockfiles so that the pip/pex caches
684+ # get invalidated on any transitive dependency update.
685+ named-caches-hash : ${{ hashFiles('requirements.txt') }}
686+ # enable the optional lmdb_store cache since we're not using remote caching.
687+ cache-lmdb-store : ' true'
688+ # install whatever version of python we need for our in-repo pants-plugins
689+ setup-python-for-plugins : ' true'
690+
669691 - name : Install virtualenv
670692 run : |
671693 ./scripts/github/install-virtualenv.sh
@@ -731,6 +753,14 @@ jobs:
731753 if : " ${{ always() }}"
732754 run : docker rm --force redis || true
733755
756+
757+ - name : Upload pants log
758+ uses : actions/upload-artifact@v2
759+ with :
760+ name : pants-log-py${{ matrix.python-version }}-nose-${{ matrix.nosetests_node_index }}
761+ path : .pants.d/pants.log
762+ if : always() # We want the log even on failures.
763+
734764 slack-notification :
735765 name : Slack notification for failed master builds
736766 if : false
0 commit comments