diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f0b77b7b7b7..cb98d0c4024 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -500,7 +500,6 @@ jobs: # NOTE: We always want to run job on master since we run some additional checks there (code # coverage, etc) # if: ${{ needs.pre_job.outputs.should_skip != 'true' || github.ref == 'refs/heads/master' }} - if: false name: '${{ matrix.name }} - Python ${{ matrix.python-version-short }}' runs-on: ubuntu-20.04 strategy: @@ -635,21 +634,21 @@ jobs: uses: actions/setup-python@v2 with: python-version: '${{ matrix.python-version }}' - - name: Cache Python Dependencies - uses: actions/cache@v2 - with: - path: | - ~/.cache/pip - virtualenv - ~/virtualenv - # TODO: maybe make the virtualenv a partial cache to exclude st2*? - # !virtualenv/lib/python*/site-packages/st2* - # !virtualenv/bin/st2* - key: ${{ runner.os }}-v4-python-${{ matrix.python-version }}-${{ hashFiles('requirements.txt', 'test-requirements.txt') }} - # Don't use alternative key as if requirements.txt has altered we - # don't want to retrieve previous cache - #restore-keys: | - # ${{ runner.os }}-v4-python-${{ matrix.python }}- + #- name: Cache Python Dependencies + # uses: actions/cache@v2 + # with: + # path: | + # ~/.cache/pip + # virtualenv + # ~/virtualenv + # # TODO: maybe make the virtualenv a partial cache to exclude st2*? + # # !virtualenv/lib/python*/site-packages/st2* + # # !virtualenv/bin/st2* + # key: ${{ runner.os }}-v4-python-${{ matrix.python-version }}-${{ hashFiles('requirements.txt', 'test-requirements.txt') }} + # # Don't use alternative key as if requirements.txt has altered we + # # don't want to retrieve previous cache + # #restore-keys: | + # # ${{ runner.os }}-v4-python-${{ matrix.python }}- - name: Cache APT Dependencies id: cache-apt-deps uses: actions/cache@v2 @@ -666,6 +665,29 @@ jobs: # install dev dependencies for Python YAML and LDAP packages # https://github.com/StackStorm/st2-auth-ldap ./scripts/github/install-apt-packages-use-cache.sh + + - name: Initialize Pants and its GHA caches + uses: pantsbuild/actions/init-pants@v6-scie-pants + # This action adds an env var to make pants use both pants.ci.toml & pants.toml. + # This action also creates 3 GHA caches (1 is optional). + # - `pants-setup` has the bootsrapped pants install + # - `pants-named-caches` has pip/wheel and PEX caches + # - `pants-lmdb-store` has the fine-grained process cache. + # If we ever use a remote cache, then we can drop this. + # Otherwise, we may need an additional workflow or job to delete old caches + # if they are not expiring fast enough, and we hit the GHA 10GB per repo max. + with: + base-branch: master + # To ignore a bad cache, bump the cache* integer. + gha-cache-key: cache0 + # This hash should include all of our lockfiles so that the pip/pex caches + # get invalidated on any transitive dependency update. + named-caches-hash: ${{ hashFiles('requirements.txt') }} + # enable the optional lmdb_store cache since we're not using remote caching. + cache-lmdb-store: 'true' + # install whatever version of python we need for our in-repo pants-plugins + setup-python-for-plugins: 'true' + - name: Install virtualenv run: | ./scripts/github/install-virtualenv.sh @@ -731,6 +753,14 @@ jobs: if: "${{ always() }}" run: docker rm --force redis || true + + - name: Upload pants log + uses: actions/upload-artifact@v2 + with: + name: pants-log-py${{ matrix.python-version }}-nose-${{ matrix.nosetests_node_index }} + path: .pants.d/pants.log + if: always() # We want the log even on failures. + slack-notification: name: Slack notification for failed master builds if: false