Skip to content

Commit

Permalink
ci(workflows): Reviewed and replaced contents of workflows with share…
Browse files Browse the repository at this point in the history
…able workflow repo
  • Loading branch information
AsifNawaz-cnic committed Nov 30, 2023
1 parent c6d765d commit 239c471
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 138 deletions.
34 changes: 0 additions & 34 deletions .github/workflows/auto-merge-dependabot-pr.yml

This file was deleted.

58 changes: 6 additions & 52 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

61 changes: 9 additions & 52 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 239c471

Please sign in to comment.