Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(workflows): Reviewed and replaced contents of workflows with shareable workflow repo #170

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 0 additions & 35 deletions .github/workflows/auto-merge-dependabot-pr.yml

This file was deleted.

61 changes: 4 additions & 57 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,61 +5,8 @@ on:
- master

jobs:
build:
name: Build
uses: ./.github/workflows/test.yml
permissions:
contents: read
packages: write

release:
name: Release
runs-on: ${{ vars.RTLDEV_MW_CI_OS }}
needs: build
permissions:
contents: write
issues: write
deployments: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-java@v4
with:
java-version: ${{ vars.RTLDEV_MW_CI_JAVA_VERSION }}
distribution: ${{ vars.RTLDEV_MW_CI_JAVA_DISTRO }}
- 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: Download Artifacts
uses: actions/download-artifact@v4
id: download
with:
name: coverage
- run: |
rm -rf target
unzip -qq -o target.zip
rm target.zip
- name: Install dependencies
run: npm ci
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.RTLDEV_MW_CI_TOKEN }}
MAVEN_OPTS: ${{ vars.MAVEN_OPTS }}
OSSRH_JIRA_USERNAME: ${{ secrets.OSSRH_JIRA_USERNAME }}
OSSRH_JIRA_PASSWORD: ${{ secrets.OSSRH_JIRA_PASSWORD }}
ENCRYPTED_C9F9AEDF26B7_KEY: ${{ secrets.ENCRYPTED_C9F9AEDF26B7_KEY }}
ENCRYPTED_C9F9AEDF26B7_IV: ${{ secrets.ENCRYPTED_C9F9AEDF26B7_IV }}
GPG_KEY_NAME: ${{ secrets.GPG_KEY_NAME }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
TEAMS_NOTIFICATION_URI: ${{ secrets.RTLDEV_MW_CI_NOTIFICATION_URI }}
COMMIT_SHA: ${{ github.sha }}
run: |
openssl aes-256-cbc -K $ENCRYPTED_C9F9AEDF26B7_KEY -iv $ENCRYPTED_C9F9AEDF26B7_IV -in codesigning.asc.enc -out codesigning.asc -d
gpg --import --batch codesigning.asc
npx semantic-release
uses: centralnicgroup-opensource/rtldev-middleware-shareable-workflows/.github/workflows/release.yml
secrets: inherit
with:
repository: ${{ github.repository }}
64 changes: 10 additions & 54 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,57 +1,13 @@
name: Test

name: Dependabot auto-merge & tests
on:
workflow_call:
pull_request:
types:
- opened
- synchronize

jobs:
lint:
name: 🧪 Linting
runs-on: ${{ vars.RTLDEV_MW_CI_OS }}
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Super Linter Code Base
uses: github/super-linter/slim@v5
env:
FILTER_REGEX_INCLUDE: "((/src/main/.*.java)|updateVersion.sh)"
DEFAULT_BRANCH: master
VALIDATE_JAVA: true
VALIDATE_BASH: true
VALIDATE_ALL_CODEBASE: false
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

test_matrix:
name: 🧪 Testing
runs-on: ${{ vars.RTLDEV_MW_CI_OS }}
needs: lint
permissions:
contents: read
strategy:
matrix:
java-version: ${{ fromJson(vars.RTLDEV_MW_CI_JAVA_MATRIX) }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Java JDK @^${{ matrix.java-version }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java-version }}
distribution: ${{ vars.RTLDEV_MW_CI_JAVA_DISTRO }}
- name: Validate & Coverage Report
run: |
mvn -B clean site package -Pdev
zip -r /home/runner/target.zip ./target
- uses: actions/upload-artifact@v4
id: upload
with:
name: coverage
path: ~/target.zip
retention-days: 1
tests:
uses: centralnicgroup-opensource/rtldev-middleware-shareable-workflows/.github/workflows/auto-merge-dependabot-pr.yml
secrets: inherit
with:
repository: ${{ github.repository }}