From d7c7b785adc1f8d1b2737783d9a8536227a8dedc Mon Sep 17 00:00:00 2001 From: dalerichardson Date: Fri, 4 Aug 2023 07:44:33 -0600 Subject: [PATCH] gha files --- .github/dependabot.yml | 5 +++++ .github/workflows/lint.yml | 11 ++++++++++ .github/workflows/release.yml | 20 ++++++++++++++++++ .github/workflows/test.yml | 11 ++++++++++ .mergify.yml | 9 ++++---- .travis.yml | 39 ----------------------------------- 6 files changed, 51 insertions(+), 44 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 682e3aa..d445205 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,5 +1,10 @@ version: 2 updates: +# Maintain dependencies for GitHub Actions +- package-ecosystem: github-actions + directory: / + schedule: + interval: weekly - package-ecosystem: terraform directory: "/" schedule: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..a5735f3 --- /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@84885d2116bdcaab046d6bf927127bb58cb74ae8 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..235787b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,20 @@ +name: Create GitHub Release + +on: + # Run on demand + workflow_dispatch: + + # Run on push to main when .bumpversion.cfg version is updated + push: + branches: + - master + paths: + - .bumpversion.cfg + +jobs: + release: + uses: plus3it/actions-workflows/.github/workflows/release.yml@86222127307c7f827e141bbc35cf0efb0e611648 + with: + mockstacktest-enable: false + secrets: + release-token: ${{ secrets.GH_RELEASES_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..9dbd6dc --- /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@86222127307c7f827e141bbc35cf0efb0e611648 diff --git a/.mergify.yml b/.mergify.yml index ad8bb94..0c77e19 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -1,15 +1,14 @@ pull_request_rules: - - name: automatic approve dependabot pull requests + - 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: automatic merge for dependabot pull requests + - name: merge dependabot pull requests conditions: - - author~=dependabot\[bot\]|dependabot-preview\[bot\] + - author=dependabot[bot] - "#approved-reviews-by>=1" actions: merge: diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 9ef765d..0000000 --- a/.travis.yml +++ /dev/null @@ -1,39 +0,0 @@ -dist: focal - -language: minimal - -stages: - - lint - - deploy - -if: branch = master OR type = pull_request OR tag is present - -jobs: - include: - - stage: lint - name: Project Syntax Verification - script: make docker/run target=lint - - stage: deploy - if: branch = master AND type = push AND repo = plus3it/salt-reposync - before_script: - - | - PRIOR_VERSION=$(git describe --abbrev=0 --tags) - RELEASE_VERSION=$(grep current_version $TRAVIS_BUILD_DIR/.bumpversion.cfg | sed 's/^.*= //' ) - RELEASE_BODY="* [SALT-REPOSYNC v$RELEASE_VERSION CHANGELOG](https://github.com/plus3it/salt-reposync/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/salt-reposync - condition: '"$PRIOR_VERSION" != "$RELEASE_VERSION"'