From da88058cf18174a83e5be6f974cb944060882fc2 Mon Sep 17 00:00:00 2001 From: dalerichardson Date: Mon, 17 Jun 2024 08:25:56 -0700 Subject: [PATCH 01/10] gha migration files --- .github/dependabot.yml | 14 +++++++++++--- .github/workflows/lint.yml | 11 +++++++++++ .github/workflows/release.yml | 19 +++++++++++++++++++ .github/workflows/test.yml | 11 +++++++++++ .mergify.yml | 1 - 5 files changed, 52 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/lint.yml create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/test.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml index e66b8d83..88138b05 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,7 +1,15 @@ version: 2 updates: + # Maintain dependencies for GitHub Actions + - package-ecosystem: github-actions + directory: / + schedule: + interval: weekly + ignore: + - dependency-name: "actions/checkout" + update-types: ["version-update:semver-major"] + # Maintain dependencies for dockerfiles - package-ecosystem: docker - directory: "/" + directory: / schedule: - interval: daily - open-pull-requests-limit: 10 + interval: weekly diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..32a4556f --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,11 @@ +name: Run lint and static analyis checks +on: + pull_request: + +concurrency: + group: lint-${{ github.head_ref || github.ref }} + cancel-in-progress: true + +jobs: + lint: + uses: plus3it/actions-workflows/.github/workflows/lint.yml@821d7899f1cf32b97306ef06ca1de31ae3274b7f diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..8eee0732 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,19 @@ +name: Create GitHub Release + +on: + # Run on demand + workflow_dispatch: + + # Run on push to main when .bumpversion.cfg version is updated + push: + branches: + - main + - master + paths: + - .bumpversion.cfg + +jobs: + release: + uses: plus3it/actions-workflows/.github/workflows/release.yml@821d7899f1cf32b97306ef06ca1de31ae3274b7f + secrets: + release-token: ${{ secrets.GH_RELEASES_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..bf5a3cb7 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,11 @@ +name: Run test jobs +on: + pull_request: + +concurrency: + group: test-${{ github.head_ref || github.ref }} + cancel-in-progress: true + +jobs: + test: + uses: plus3it/actions-workflows/.github/workflows/test.yml@821d7899f1cf32b97306ef06ca1de31ae3274b7f diff --git a/.mergify.yml b/.mergify.yml index 4454b1ab..1d5138d3 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -2,7 +2,6 @@ pull_request_rules: - name: approve dependabot pull requests conditions: - author=dependabot[bot] - - status-success=Travis CI - Pull Request actions: review: type: APPROVE From 19c51146b753ae74282d5ce7876ee4796c6d76cf Mon Sep 17 00:00:00 2001 From: dalerichardson Date: Mon, 17 Jun 2024 10:30:26 -0700 Subject: [PATCH 02/10] point to different makefile --- Makefile => Makefile.spel | 6 +++--- build/vagrant/Makefile | 2 +- build/vagrant/build-spel-vagrant.sh | 2 +- build/vagrant/buildspec-vagrant.yml | 4 ++-- buildspec.yml | 4 ++-- spel/scripts/virtualbox.sh | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) rename Makefile => Makefile.spel (94%) diff --git a/Makefile b/Makefile.spel similarity index 94% rename from Makefile rename to Makefile.spel index 2bc9a5c4..23e57a41 100644 --- a/Makefile +++ b/Makefile.spel @@ -45,13 +45,13 @@ endif all: build docs/lint: - $(MAKE) -f Makefile.tardigrade-ci docs/lint + $(MAKE) -f Makefile.spel docs/lint docs/generate: - $(MAKE) -f Makefile.tardigrade-ci docs/generate + $(MAKE) -f Makefile.spel docs/generate install: - $(MAKE) -f Makefile.tardigrade-ci packer/install + $(MAKE) -f Makefile.spel packer/install bash -eo pipefail ./build/install.sh # The profile and region envs are used only by the `pre_build`, `build`, and `post_build` diff --git a/build/vagrant/Makefile b/build/vagrant/Makefile index 1ca650d2..79b4237f 100644 --- a/build/vagrant/Makefile +++ b/build/vagrant/Makefile @@ -30,7 +30,7 @@ $(info SPEL_VERSION=$(SPEL_VERSION)) all: build install: - $(MAKE) -f ../../Makefile.tardigrade-ci packer/install + $(MAKE) -f ../../Makefile.spel packer/install build: export PACKER_LOG = 1 build: export PACKER_LOG_PATH = .spel/$(SPEL_VERSION)/packer.build-spel-vagrant.log diff --git a/build/vagrant/build-spel-vagrant.sh b/build/vagrant/build-spel-vagrant.sh index b8bee33a..d388e631 100644 --- a/build/vagrant/build-spel-vagrant.sh +++ b/build/vagrant/build-spel-vagrant.sh @@ -41,7 +41,7 @@ if [[ -n "${SPEL_REPO_COMMIT:-}" ]] ; then fi # install packer -make -f Makefile.tardigrade-ci packer/install +make -f Makefile.spel packer/install # build vagrant box mkdir -p "${CLONE_DIR}/.spel/${SPEL_VERSION:?}/" diff --git a/build/vagrant/buildspec-vagrant.yml b/build/vagrant/buildspec-vagrant.yml index f2819424..6c63bcae 100644 --- a/build/vagrant/buildspec-vagrant.yml +++ b/build/vagrant/buildspec-vagrant.yml @@ -12,10 +12,10 @@ env: phases: install: commands: - - make -C build/vagrant install + - make -C -f Makefile.spel build/vagrant install build: commands: - - make -C build/vagrant build + - make -C -f Makefile.spel build/vagrant build post_build: commands: - find . -type f \( -name '*.box' -o -name '*.ova' \) -print0 | xargs -0 rm -f diff --git a/buildspec.yml b/buildspec.yml index ecf90f2a..e711558a 100644 --- a/buildspec.yml +++ b/buildspec.yml @@ -19,10 +19,10 @@ phases: - make install build: commands: - - make build + - make -f Makefile.spel build post_build: commands: - - make post_build + - make -f Makefile.spel post_build - find . -type f \( -name '*.box' -o -name '*.ova' \) -print0 | xargs -0 rm -f artifacts: diff --git a/spel/scripts/virtualbox.sh b/spel/scripts/virtualbox.sh index 69ae813e..fb418e19 100644 --- a/spel/scripts/virtualbox.sh +++ b/spel/scripts/virtualbox.sh @@ -10,7 +10,7 @@ echo "installing virtualbox guest addition dependencies" VBOX_GUEST_DEPS=(kernel-devel kernel-headers gcc perl) test "$(rpm --quiet -q bzip2)$?" -eq 0 || VBOX_GUEST_DEPS+=(bzip2) bash /tmp/retry.sh 5 yum -y install "${VBOX_GUEST_DEPS[@]}" -bash /tmp/retry.sh 5 yum -y install dkms make +bash /tmp/retry.sh 5 yum -y install dkms make -f Makefile.spel KERN_DIR=/lib/modules/$(uname -r)/build export KERN_DIR From 751ce344b0120256089ed0a13c3a631e2181f979 Mon Sep 17 00:00:00 2001 From: dalerichardson Date: Mon, 17 Jun 2024 11:15:29 -0700 Subject: [PATCH 03/10] fix actions --- Makefile.tardigrade-ci => Makefile | 0 Makefile.spel | 6 +++--- build/vagrant/Makefile | 2 +- build/vagrant/build-spel-vagrant.sh | 2 +- build/vagrant/buildspec-vagrant.yml | 4 ++-- buildspec.yml | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) rename Makefile.tardigrade-ci => Makefile (100%) diff --git a/Makefile.tardigrade-ci b/Makefile similarity index 100% rename from Makefile.tardigrade-ci rename to Makefile diff --git a/Makefile.spel b/Makefile.spel index 23e57a41..15ee7c60 100644 --- a/Makefile.spel +++ b/Makefile.spel @@ -45,13 +45,13 @@ endif all: build docs/lint: - $(MAKE) -f Makefile.spel docs/lint + $(MAKE) -f Makefile docs/lint docs/generate: - $(MAKE) -f Makefile.spel docs/generate + $(MAKE) -f Makefile docs/generate install: - $(MAKE) -f Makefile.spel packer/install + $(MAKE) -f Makefile packer/install bash -eo pipefail ./build/install.sh # The profile and region envs are used only by the `pre_build`, `build`, and `post_build` diff --git a/build/vagrant/Makefile b/build/vagrant/Makefile index 79b4237f..70175b39 100644 --- a/build/vagrant/Makefile +++ b/build/vagrant/Makefile @@ -30,7 +30,7 @@ $(info SPEL_VERSION=$(SPEL_VERSION)) all: build install: - $(MAKE) -f ../../Makefile.spel packer/install + $(MAKE) -f ../../Makefile packer/install build: export PACKER_LOG = 1 build: export PACKER_LOG_PATH = .spel/$(SPEL_VERSION)/packer.build-spel-vagrant.log diff --git a/build/vagrant/build-spel-vagrant.sh b/build/vagrant/build-spel-vagrant.sh index d388e631..d24862fa 100644 --- a/build/vagrant/build-spel-vagrant.sh +++ b/build/vagrant/build-spel-vagrant.sh @@ -41,7 +41,7 @@ if [[ -n "${SPEL_REPO_COMMIT:-}" ]] ; then fi # install packer -make -f Makefile.spel packer/install +make -f Makefile packer/install # build vagrant box mkdir -p "${CLONE_DIR}/.spel/${SPEL_VERSION:?}/" diff --git a/build/vagrant/buildspec-vagrant.yml b/build/vagrant/buildspec-vagrant.yml index 6c63bcae..8adbea72 100644 --- a/build/vagrant/buildspec-vagrant.yml +++ b/build/vagrant/buildspec-vagrant.yml @@ -12,10 +12,10 @@ env: phases: install: commands: - - make -C -f Makefile.spel build/vagrant install + - make -C -f Makefile build/vagrant install build: commands: - - make -C -f Makefile.spel build/vagrant build + - make -C -f Makefile build/vagrant build post_build: commands: - find . -type f \( -name '*.box' -o -name '*.ova' \) -print0 | xargs -0 rm -f diff --git a/buildspec.yml b/buildspec.yml index e711558a..45f29dc5 100644 --- a/buildspec.yml +++ b/buildspec.yml @@ -19,10 +19,10 @@ phases: - make install build: commands: - - make -f Makefile.spel build + - make -f Makefile build post_build: commands: - - make -f Makefile.spel post_build + - make -f Makefile post_build - find . -type f \( -name '*.box' -o -name '*.ova' \) -print0 | xargs -0 rm -f artifacts: From ae5d30de46ccbd14417fc5e8da2840140de9773a Mon Sep 17 00:00:00 2001 From: dalerichardson Date: Mon, 17 Jun 2024 11:45:09 -0700 Subject: [PATCH 04/10] additional corrections --- build/vagrant/build-spel-vagrant.sh | 2 +- build/vagrant/buildspec-vagrant.yml | 4 ++-- spel/scripts/virtualbox.sh | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/vagrant/build-spel-vagrant.sh b/build/vagrant/build-spel-vagrant.sh index d24862fa..62c6f8f6 100644 --- a/build/vagrant/build-spel-vagrant.sh +++ b/build/vagrant/build-spel-vagrant.sh @@ -41,7 +41,7 @@ if [[ -n "${SPEL_REPO_COMMIT:-}" ]] ; then fi # install packer -make -f Makefile packer/install +make packer/install # build vagrant box mkdir -p "${CLONE_DIR}/.spel/${SPEL_VERSION:?}/" diff --git a/build/vagrant/buildspec-vagrant.yml b/build/vagrant/buildspec-vagrant.yml index 8adbea72..f2819424 100644 --- a/build/vagrant/buildspec-vagrant.yml +++ b/build/vagrant/buildspec-vagrant.yml @@ -12,10 +12,10 @@ env: phases: install: commands: - - make -C -f Makefile build/vagrant install + - make -C build/vagrant install build: commands: - - make -C -f Makefile build/vagrant build + - make -C build/vagrant build post_build: commands: - find . -type f \( -name '*.box' -o -name '*.ova' \) -print0 | xargs -0 rm -f diff --git a/spel/scripts/virtualbox.sh b/spel/scripts/virtualbox.sh index fb418e19..69ae813e 100644 --- a/spel/scripts/virtualbox.sh +++ b/spel/scripts/virtualbox.sh @@ -10,7 +10,7 @@ echo "installing virtualbox guest addition dependencies" VBOX_GUEST_DEPS=(kernel-devel kernel-headers gcc perl) test "$(rpm --quiet -q bzip2)$?" -eq 0 || VBOX_GUEST_DEPS+=(bzip2) bash /tmp/retry.sh 5 yum -y install "${VBOX_GUEST_DEPS[@]}" -bash /tmp/retry.sh 5 yum -y install dkms make -f Makefile.spel +bash /tmp/retry.sh 5 yum -y install dkms make KERN_DIR=/lib/modules/$(uname -r)/build export KERN_DIR From e497f5ee3d41eea6e85a3d18af6c8848b534220d Mon Sep 17 00:00:00 2001 From: dalerichardson Date: Mon, 17 Jun 2024 12:46:06 -0700 Subject: [PATCH 05/10] update distro version --- tests/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/requirements.txt b/tests/requirements.txt index 8b2644e6..c81426fc 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,4 +1,4 @@ -distro==1.6.0 +distro==1.9.0 pytest==6.2.5 pytest-logger==0.5.1 pytest-testinfra==6.5.0 From 42af45b767d04383e74e14547525b30520a9667a Mon Sep 17 00:00:00 2001 From: Loren Gordon Date: Mon, 30 Dec 2024 06:30:11 -0800 Subject: [PATCH 06/10] Installs test requirements before linting --- .github/workflows/lint.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 32a4556f..c736d164 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -9,3 +9,5 @@ concurrency: jobs: lint: uses: plus3it/actions-workflows/.github/workflows/lint.yml@821d7899f1cf32b97306ef06ca1de31ae3274b7f + with: + tardigradelint-target: install/pip_requirements/tests/requirements.txt lint From fe8c9f950b2ed47b9a09e4ae00d652ec8cbb9ce9 Mon Sep 17 00:00:00 2001 From: Loren Gordon Date: Mon, 30 Dec 2024 06:36:58 -0800 Subject: [PATCH 07/10] Points buildspec at correct makefile --- build/vagrant/build-spel-vagrant.sh | 2 +- buildspec.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/vagrant/build-spel-vagrant.sh b/build/vagrant/build-spel-vagrant.sh index 62c6f8f6..f08bc7a2 100644 --- a/build/vagrant/build-spel-vagrant.sh +++ b/build/vagrant/build-spel-vagrant.sh @@ -41,7 +41,7 @@ if [[ -n "${SPEL_REPO_COMMIT:-}" ]] ; then fi # install packer -make packer/install +make packer/install # build vagrant box mkdir -p "${CLONE_DIR}/.spel/${SPEL_VERSION:?}/" diff --git a/buildspec.yml b/buildspec.yml index 45f29dc5..6a0482c3 100644 --- a/buildspec.yml +++ b/buildspec.yml @@ -16,13 +16,13 @@ phases: SPEL_VERSION=$(date +%Y.%m.dev%s) export SPEL_VERSION fi - - make install + - make -f Makefile.spel install build: commands: - - make -f Makefile build + - make -f Makefile.spel build post_build: commands: - - make -f Makefile post_build + - make -f Makefile.spel post_build - find . -type f \( -name '*.box' -o -name '*.ova' \) -print0 | xargs -0 rm -f artifacts: From 35a37333339ef7a81e3aa8b7c054e2dbdc54e156 Mon Sep 17 00:00:00 2001 From: Loren Gordon Date: Mon, 30 Dec 2024 06:37:21 -0800 Subject: [PATCH 08/10] Removes test workflow since it is not used in this project --- .github/workflows/test.yml | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index bf5a3cb7..00000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,11 +0,0 @@ -name: Run test jobs -on: - pull_request: - -concurrency: - group: test-${{ github.head_ref || github.ref }} - cancel-in-progress: true - -jobs: - test: - uses: plus3it/actions-workflows/.github/workflows/test.yml@821d7899f1cf32b97306ef06ca1de31ae3274b7f From 47a388133c153482892d84af030db59950010142 Mon Sep 17 00:00:00 2001 From: Loren Gordon Date: Mon, 30 Dec 2024 06:43:13 -0800 Subject: [PATCH 09/10] Adds dependabot config for tests python dependendencies --- .github/dependabot.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 88138b05..8c384cf4 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -13,3 +13,12 @@ updates: directory: / schedule: interval: weekly + - package-ecosystem: pip + directory: "/tests" + schedule: + interval: weekly + open-pull-requests-limit: 10 + groups: + python: + patterns: + - "*" From d34b5268bdec0cfb1f9d70f6c8c622df32937b5e Mon Sep 17 00:00:00 2001 From: Loren Gordon Date: Mon, 30 Dec 2024 08:39:30 -0800 Subject: [PATCH 10/10] Disables mockstack test in release workflow --- .github/workflows/release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8eee0732..2d5dee74 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,3 +17,5 @@ jobs: uses: plus3it/actions-workflows/.github/workflows/release.yml@821d7899f1cf32b97306ef06ca1de31ae3274b7f secrets: release-token: ${{ secrets.GH_RELEASES_TOKEN }} + with: + mockstacktest-enable: false