Skip to content

Commit

Permalink
Merge pull request #132 from StackStorm-Exchange/gha
Browse files Browse the repository at this point in the history
gha: cleanups

- set FORCE_CHECK_ALL_FILES=true by default (see #88)
- do not obscure the pip output with `pip -q`. Instead we can use gha output groups to jump past it.
- if a different branch of st2 or lint-configs is selected, then we need more than just one commit (`fetch-depth: 1`). So, if the branch is set to anything other than the default branch (`master`) then set `fetch-depth: 0` so that all history gets included.
  • Loading branch information
cognifloyd authored Dec 29, 2021
2 parents 8469618 + 8b68ada commit 03a29cc
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/actions/checkout/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ runs:
repository: StackStorm/st2
ref: ${{ inputs.st2-branch }}
path: st2
fetch-depth: 1
fetch-depth: ${{ inputs.st2-branch == 'master' && 1 || 0 }}

- name: Checkout lint-configs repo
uses: actions/checkout@v2
with:
repository: StackStorm/lint-configs
ref: ${{ inputs.lint-configs-branch }}
path: lint-configs
fetch-depth: 1
fetch-depth: ${{ inputs.lint-configs-branch == 'master' && 1 || 0 }}
6 changes: 3 additions & 3 deletions .github/actions/py-dependencies/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ runs:
# grab the pinned versions from the st2 checkout
grep -E "${REQUIREMENTS// /[ =><]|}[ =><]" ${ST2_REPO_PATH}/test-requirements.txt > ${GITHUB_WORKSPACE}/${req_file}
# grab any local pinned requirements
grep -e '=' "${REQUIREMENTS_DIR}/requirements-dev.txt" >> ${GITHUB_WORKSPACE}/${req_file}
grep -e '=' "${REQUIREMENTS_DIR}/${req_file}" >> ${GITHUB_WORKSPACE}/${req_file} || true
echo ${GITHUB_WORKSPACE}/${req_file}:
cat ${GITHUB_WORKSPACE}/${req_file}
echo
# install
${VIRTUALENV_DIR}/bin/pip install -q -r ${GITHUB_WORKSPACE}/${req_file}
${VIRTUALENV_DIR}/bin/pip install -r ${GITHUB_WORKSPACE}/${req_file}
echo "::endgroup::"
done
Expand All @@ -99,7 +99,7 @@ runs:
working-directory: st2
run: |
echo "::group::Install StackStorm Requirements"
${VIRTUALENV_DIR}/bin/pip install -q -r requirements.txt
${VIRTUALENV_DIR}/bin/pip install -r requirements.txt
echo "::endgroup::"
- name: Install Runners
Expand Down
8 changes: 8 additions & 0 deletions .github/actions/test/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ inputs:
see: https://docs.stackstorm.com/reference/sharing_code_sensors_actions.html
default: false
required: false
force-check-all-files:
description: |
Pushes to the default branch always check all files.
If needed, a pack can limit checks for PRs by setting this to false.
default: true
required: false

outputs:
pack-name:
Expand Down Expand Up @@ -49,6 +55,8 @@ runs:
echo "BASE_BRANCH=origin/${DEFAULT_BRANCH}" >> ${GITHUB_ENV}
if [[ "${DEFAULT_BRANCH}" == "${GITHUB_REF_NAME}" ]]; then
echo "FORCE_CHECK_ALL_FILES=true" >> ${GITHUB_ENV}
else
echo "FORCE_CHECK_ALL_FILES=${{ inputs.force-check-all-files }}" >> ${GITHUB_ENV}
fi
if [[ "true" == "${{ inputs.enable-common-libs }}" ]]; then
echo "Common libs PATH selected"
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/pack-build_and_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ on:
required: false
type: string
default: master
force-check-all-files:
required: false
type: boolean
default: true

jobs:
build_and_test:
Expand Down Expand Up @@ -60,6 +64,7 @@ jobs:
uses: StackStorm-Exchange/ci/.github/actions/test@master
with:
enable-common-libs: ${{ inputs.enable-common-libs }}
force-check-all-files: ${{ inputs.force-check-all-files }}

services:
mongo:
Expand Down

0 comments on commit 03a29cc

Please sign in to comment.