diff --git a/.github/workflows/auto-merge-dependabot-pr.yml b/.github/workflows/auto-merge-dependabot-pr.yml deleted file mode 100644 index e73f42e..0000000 --- a/.github/workflows/auto-merge-dependabot-pr.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Dependabot auto-merge -on: - pull_request: - types: - - opened - - synchronize - -jobs: - tests: - uses: ./.github/workflows/test.yml - secrets: inherit - permissions: - contents: read - dependabot: - if: ${{ github.actor == 'dependabot[bot]' }} - name: Auto-merge Dependabot PR - runs-on: ${{ vars.RTLDEV_MW_CI_OS }} - needs: tests - permissions: - contents: write - pull-requests: write - steps: - - name: Dependabot metadata - id: metadata - uses: dependabot/fetch-metadata@v1 - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" - - name: Enable auto-merge for Dependabot PRs - # (fixes, features but not major upgrades!) - if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor'}} - run: gh pr merge --auto -d -r "$PR_URL" - env: - PR_URL: ${{github.event.pull_request.html_url}} - GITHUB_TOKEN: ${{secrets.RTLDEV_MW_CI_TOKEN}} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4a12e84..02b2c4f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,59 +2,13 @@ name: Release on: push: branches: - - "master" + - master jobs: - build: - name: "Build" - uses: ./.github/workflows/test.yml - permissions: - contents: read - release: - name: Release - runs-on: ${{ vars.RTLDEV_MW_CI_OS }} - needs: build - permissions: - contents: write - issues: write - deployments: write - container: - image: perldocker/perl-tester:latest + uses: centralnicgroup-opensource/rtldev-middleware-shareable-workflows/.github/workflows/release.yml + secrets: inherit + with: + requestedFrom: perl-sdk - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - persist-credentials: false - - name: Setup NodeJS ${{ vars.RTLDEV_MW_CI_NODE_VERSION }} - uses: actions/setup-node@v4 - with: - node-version: ${{ vars.RTLDEV_MW_CI_NODE_VERSION }} - check-latest: true - cache: "npm" - - name: APT Packages - run: apt install -y perl-doc ctags perltidy lsb-release - - name: SW Versions - run: | - lsb_release -a - node -v - npm -v - perl -V - - name: install perl dependencies - run: | - cpm install -g --no-test --show-build-log-on-failure --cpanfile cpanfile - perl Makefile.PL - make - - name: Install dependencies - run: npm ci - - name: Release - env: - GITHUB_TOKEN: ${{ secrets.RTLDEV_MW_CI_TOKEN }} - CPAN_USER: ${{ secrets.CPAN_USER }} - CPAN_PASSWORD: ${{ secrets.CPAN_PASSWORD }} - TEAMS_NOTIFICATION_URI: ${{ secrets.RTLDEV_MW_CI_NOTIFICATION_URI }} - COMMIT_SHA: ${{ github.sha }} - # we are root as of perl-tester image, npx won't invoke with root rights - run: ./node_modules/.bin/semantic-release + \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 56eb532..16ede6f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,55 +1,12 @@ -name: Linting & Coverage - +name: Dependabot auto-merge & tests on: - workflow_call: + pull_request: + types: + - opened + - synchronize jobs: - test: - name: 🧪 Linting - runs-on: ${{ vars.RTLDEV_MW_CI_OS }} - permissions: - contents: read - container: - image: perldocker/perl-tester:latest - - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - persist-credentials: false - - name: APT Packages - run: apt install -y perl-doc ctags perltidy - - name: Super Linter Code Base - uses: github/super-linter/slim@v5 - env: - FILTER_REGEX_INCLUDE: "/lib/*|/t/*|/scripts/.*.sh|updateVersion.sh" - DEFAULT_BRANCH: master - VALIDATE_PERL: true - VALIDATE_BASH: true - VALIDATE_ALL_CODEBASE: false - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - test_matrix: - name: 🧪 Testing - needs: test - runs-on: ${{ vars.RTLDEV_MW_CI_OS }} - permissions: - contents: read - container: - image: perldocker/perl-tester:${{ matrix.perl-version }} - strategy: - matrix: - perl-version: ${{ fromJson(vars.RTLDEV_MW_CI_PERL_MATRIX) }} - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - persist-credentials: false - - name: APT Packages - run: apt install -y perl-doc ctags perltidy - - name: Generate Coverage Report - run: | - cpm install -g --no-test --show-build-log-on-failure --cpanfile cpanfile - ./scripts/coverage.sh + tests: + uses: centralnicgroup-opensource/rtldev-middleware-shareable-workflows/.github/workflows/auto-merge-dependabot-pr.yml + with: + requestedFrom: perl-sdk