Skip to content

Commit

Permalink
fix: Fix guthub workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
akak1977 committed Sep 5, 2022
1 parent 2484c06 commit ff47729
Show file tree
Hide file tree
Showing 7 changed files with 146 additions and 100 deletions.
75 changes: 57 additions & 18 deletions .github/workflows/main.yml → .github/workflows/module-ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# v1.1.12
# v3.200.16
name: Module CI

on:
Expand All @@ -11,6 +11,7 @@ on:
- 'README.md'
- 'LICENSE'
- '**/argoDeploy.json'
- '**/cloudDeploy.json'
- samples/**
branches:
[master, dev]
Expand All @@ -23,12 +24,15 @@ on:
- 'README.md'
- 'LICENSE'
- '**/argoDeploy.json'
- '**/cloudDeploy.json'
- samples/**

jobs:
ci:
if: ${{ github.actor != 'dependabot[bot]' && (github.event.pull_request.head.repo.full_name == github.repository || github.event.pull_request.head.repo.full_name == '') }} # Check that PR not from forked repo and not from Dependabot
runs-on: ubuntu-latest
if: ${{ github.actor != 'dependabot[bot]' &&
(github.event.pull_request.head.repo.full_name == github.repository ||
github.event.pull_request.head.repo.full_name == '') }} # Check that PR not from forked repo and not from Dependabot
runs-on: ubuntu-20.04
env:
CLOUD_INSTANCE_BASE_URL: ${{secrets.CLOUD_INSTANCE_BASE_URL}}
CLIENT_ID: ${{secrets.CLIENT_ID}}
Expand All @@ -44,6 +48,8 @@ jobs:
outputs:
artifactUrl: ${{ steps.artifactUrl.outputs.download_url }}
jira-keys: ${{ steps.jira_keys.outputs.jira-keys }}
version: ${{ steps.artifact_ver.outputs.shortVersion }}
moduleId: ${{ steps.artifact_ver.outputs.moduleId }}

steps:

Expand All @@ -52,7 +58,7 @@ jobs:
run: |
echo "RELEASE_STATUS=true" >> $GITHUB_ENV
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0

Expand Down Expand Up @@ -206,13 +212,15 @@ jobs:
deploy:
if: ${{ (github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/master') && github.event_name == 'push' }}
needs: ci
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
env:
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}
CLOUD_INSTANCE_BASE_URL: ${{secrets.CLOUD_INSTANCE_BASE_URL}}
CLIENT_ID: ${{secrets.CLIENT_ID}}
CLIENT_SECRET: ${{secrets.CLIENT_SECRET}}
DEPLOYMENT_ENV: 'dev'
SLEEP_TIME: '5m'
ARGO_SERVER: 'argo.govirto.com'

steps:
- name: Set DEPLOYMENT_ENV variable
Expand Down Expand Up @@ -246,20 +254,19 @@ jobs:
forceCommit: 'true'
cmPath: ${{ steps.deployConfig.outputs.cmPath }}

- name: Sleep for ${{ env.SLEEP_TIME }}
run: sleep ${{ env.SLEEP_TIME }}
shell: bash

- name: Wait for environment is up
shell: pwsh
timeout-minutes: 15
run: |
do {
Start-Sleep -s 15
$statusBage = (Invoke-WebRequest -Uri "https://argo.govirto.com/api/badge?name=${{ steps.deployConfig.outputs.deployAppName }}").Content
$syncedAndHealthy = $statusBage.Contains('>Healthy<') -and $statusBage.Contains('>Synced<')
if (-not $syncedAndHealthy) {
Write-Host "Sync pending..."
}
}
while (-not $syncedAndHealthy)
uses: VirtoCommerce/vc-github-actions/vc-argocd-cli@master
timeout-minutes: 10
id: argocd-cli
with:
server: ${{env.ARGO_SERVER}}
username: ${{ secrets.ARGOCD_LOGIN }}
password: ${{ secrets.ARGOCD_PASSWORD }}
command: app wait ${{ steps.deployConfig.outputs.deployAppName }}

- name: DEPLOY_STATE::successful
if: success()
Expand Down Expand Up @@ -304,3 +311,35 @@ jobs:
environment-id: ${{ steps.deployConfig.outputs.environmentId }}
environment-display-name: ${{ steps.deployConfig.outputs.environmentName }}
environment-type: ${{ steps.deployConfig.outputs.environmentType }}

module-katalon-tests:
if: ${{ (github.ref == 'refs/heads/dev') && github.event_name == 'push' }}
needs: 'ci'
uses: VirtoCommerce/.github/.github/workflows/e2e.yml@main
with:
katalonRepo: 'VirtoCommerce/vc-quality-gate-katalon'
katalonRepoBranch: 'dev'
testSuite: 'Test Suites/Modules/Platform_collection'
installModules: 'true'
installCustomModule: 'true'
customModuleId: ${{ needs.ci.outputs.moduleId }}
customModuleUrl: ${{ needs.ci.outputs.artifactUrl }}
secrets:
envPAT: ${{ secrets.REPO_TOKEN }}
katalonApiKey: ${{ secrets.KATALON_API_KEY }}

deploy-cloud-demo:
if: ${{ (github.ref == 'refs/heads/master') && github.event_name == 'push' }}
needs: ci
uses: VirtoCommerce/.github/.github/workflows/[email protected]
with:
releaseSource: module
releaseType: GithubReleases
moduleId: ${{ needs.ci.outputs.moduleId }}
moduleVer: ${{ needs.ci.outputs.version }}
argoServer: 'argo.virtocommerce.cloud'
matrix: '{"include":[{"envName": "prod", "confPath": "cloudDeploy.json"}]}'
secrets:
envPAT: ${{ secrets.REPO_TOKEN }}
argoLogin: ${{ secrets.ARGOCD_LOGIN }}
argoPassword: ${{ secrets.ARGOCD_PASSWORD }}
78 changes: 78 additions & 0 deletions .github/workflows/module-release-hotfix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# v3.200.16
name: Release hotfix

on:
workflow_dispatch:
inputs:
incrementPatch:
description: 'Increment patch version.'
required: true
default: true
type: boolean

jobs:
test:
uses: VirtoCommerce/.github/.github/workflows/[email protected]
secrets:
sonarToken: ${{ secrets.SONAR_TOKEN }}

build:
uses: VirtoCommerce/.github/.github/workflows/[email protected]
with:
uploadPackage: 'true'
uploadDocker: 'false'
forceVersionSuffix: 'false'
incrementPatch: ${{ github.event.inputs.incrementPatch }}
secrets:
envPAT: ${{ secrets.REPO_TOKEN }}

get-metadata:
runs-on: ubuntu-20.04
outputs:
changelog: ${{ steps.changelog.outputs.changelog }}
steps:

- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Get Changelog
id: changelog
uses: VirtoCommerce/vc-github-actions/changelog-generator@master

publish-github-release:
needs:
[build, test, get-metadata]
uses: VirtoCommerce/.github/.github/workflows/[email protected]
with:
fullKey: ${{ needs.build.outputs.packageFullKey }}
changeLog: '${{ needs.get-metadata.outputs.changeLog }}'
incrementPatch: ${{ github.event.inputs.incrementPatch }}

secrets:
envPAT: ${{ secrets.GITHUB_TOKEN }}
nugetKey: ${{ secrets.NUGET_KEY }}

increment-version:
needs:
[publish-github-release]
if: ${{ github.event.inputs.incrementPatch == 'true' }}
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install VirtoCommerce.GlobalTool
uses: VirtoCommerce/vc-github-actions/setup-vcbuild@master

- name: Setup Git Credentials
uses: VirtoCommerce/vc-github-actions/setup-git-credentials-github@master
with:
githubToken: ${{ secrets.REPO_TOKEN }}

- name: Increment Version
run: |
vc-build IncrementPatch
git add Directory.Build.props *module.manifest
git commit -m "ci: Auto IncrementPatch"
git push
8 changes: 4 additions & 4 deletions .github/workflows/publish-nugets.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# v3.200.13
# v3.200.16
name: Publish nuget

on:
Expand All @@ -12,12 +12,12 @@ on:

jobs:
test:
uses: VirtoCommerce/.github/.github/workflows/[email protected].13
uses: VirtoCommerce/.github/.github/workflows/[email protected].16
secrets:
sonarToken: ${{ secrets.SONAR_TOKEN }}

build:
uses: VirtoCommerce/.github/.github/workflows/[email protected].13
uses: VirtoCommerce/.github/.github/workflows/[email protected].16
with:
uploadPackage: 'true'
uploadDocker: 'false'
Expand All @@ -28,7 +28,7 @@ jobs:
publish-nuget:
needs:
[build, test]
uses: VirtoCommerce/.github/.github/workflows/[email protected].13
uses: VirtoCommerce/.github/.github/workflows/[email protected].16
with:
fullKey: ${{ needs.build.outputs.packageFullKey }}
forceGithub: false
Expand Down
74 changes: 0 additions & 74 deletions .github/workflows/release-hotfix.yml

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# v1.0.0
# v3.200.16
name: Release

on:
workflow_dispatch:

jobs:
release:
uses: VirtoCommerce/.github/.github/workflows/[email protected]
uses: VirtoCommerce/.github/.github/workflows/[email protected].16
secrets:
envPAT: ${{ secrets.REPO_TOKEN }}
envPAT: ${{ secrets.REPO_TOKEN }}
1 change: 0 additions & 1 deletion .nuke

This file was deleted.

4 changes: 4 additions & 0 deletions .nuke/parameters.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "./build.schema.json",
"Solution": "VirtoCommerce.PricingModule.sln"
}

0 comments on commit ff47729

Please sign in to comment.