From 37f2561ce4d346f2e08475dbe8273c1765d2173e Mon Sep 17 00:00:00 2001 From: dalerichardson Date: Mon, 17 Jun 2024 08:25:56 -0700 Subject: [PATCH] gha migration files --- .github/dependabot.yml | 14 ++++++++++--- .github/workflows/lint.yml | 11 ++++++++++ .github/workflows/release.yml | 19 +++++++++++++++++ .github/workflows/test.yml | 11 ++++++++++ .mergify.yml | 25 ++-------------------- .travis.yml | 39 ----------------------------------- 6 files changed, 54 insertions(+), 65 deletions(-) create mode 100644 .github/workflows/lint.yml create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/test.yml delete mode 100644 .travis.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 ea69d761..0c77e195 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -1,36 +1,15 @@ pull_request_rules: - name: approve dependabot pull requests conditions: - - author~=dependabot\[bot\]|dependabot-preview\[bot\] - - status-success=Travis CI - Pull Request + - author=dependabot[bot] actions: review: type: APPROVE - - name: comment to start codebuild jobs - conditions: - - author~=dependabot\[bot\]|dependabot-preview\[bot\] - - "#approved-reviews-by>=1" - actions: - comment: - message: go codebuild go - - - name: comment to start vagrant job - conditions: - - author~=dependabot\[bot\]|dependabot-preview\[bot\] - - "#approved-reviews-by>=1" - actions: - comment: - message: go vagrant go - - name: merge dependabot pull requests conditions: - - author~=dependabot\[bot\]|dependabot-preview\[bot\] + - author=dependabot[bot] - "#approved-reviews-by>=1" - # Must pass codebuild jobs before merge - - status-success=codebuild/p3-spel-commercial-ci/pr - - status-success=codebuild/p3-spel-govcloud-ci/pr - - status-success=codebuild/p3-spel-vagrant-ci/pr actions: merge: method: merge diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 046b4040..00000000 --- a/.travis.yml +++ /dev/null @@ -1,39 +0,0 @@ -dist: focal - -language: python -python: "3.10" - -if: branch = master OR type = pull_request - -jobs: - include: - - stage: lint - name: Project Syntax Verification - install: - - pip install -r tests/requirements.txt - - make -f Makefile.tardigrade-ci lint/install - script: make -f Makefile.tardigrade-ci lint - - stage: deploy - if: branch = master AND type = push AND repo = plus3it/spel - before_script: - - | - PRIOR_VERSION=$(git describe --abbrev=0 --tags) - RELEASE_VERSION=$(grep current_version $TRAVIS_BUILD_DIR/.bumpversion.cfg | sed 's/^.*= //' ) - RELEASE_BODY="* [SPEL v$RELEASE_VERSION CHANGELOG](https://github.com/plus3it/spel/blob/$RELEASE_VERSION/CHANGELOG.md)" - export PRIOR_VERSION RELEASE_VERSION RELEASE_BODY - script: skip - before_deploy: - - | - (set -x; git tag -a $RELEASE_VERSION -m $RELEASE_VERSION) - deploy: - provider: releases - api_key: $GH_RELEASES_TOKEN - name: $RELEASE_VERSION - body: $RELEASE_BODY - tag_name: $RELEASE_VERSION - target_commitish: $TRAVIS_COMMIT - draft: false - on: - branch: master - repo: plus3it/spel - condition: '"$PRIOR_VERSION" != "$RELEASE_VERSION"'