Skip to content

Commit

Permalink
NAS-1234 Add github pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
jeskepetr committed Nov 28, 2023
1 parent d323758 commit 845c728
Show file tree
Hide file tree
Showing 2 changed files with 94 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/post-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---

on:
push:
tags:

jobs:
###########################
# BUILD & PUBLISH STAGE
###########################
test-kotlin:
runs-on: infra1-small
if: false
steps:
- uses: actions/checkout@v3
- name: cache
uses: actions/cache@v3
with:
key: kotlin-build
path: .gradle
- name: Get Tag Name
run: echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Publish to Nexus and to GitLab with Gradle Wrapper
env:
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
GITLAB_PACKAGES_UPLOAD_TOKEN: ${{ secrets.GITLAB_PACKAGES_UPLOAD_TOKEN }}
run: |
export GRADLE_USER_HOME=`pwd`/.gradle
./gradlew -Pversion=$TAG_NAME publish --info
64 changes: 64 additions & 0 deletions .github/workflows/pre-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
on:
pull_request:
branches: [ master ]

jobs:
###########################
# COMPLIANCE CHECK STAGE
###########################
compliance-check:
runs-on: infra1-small
container:
image: '020413372491.dkr.ecr.us-east-1.amazonaws.com/infra/compliance-check:latest'
env:
GITLAB_API_PRIVATE_TOKEN: ${{ secrets.GITLAB_API_PRIVATE_TOKEN }}
steps:
- uses: actions/checkout@v3
- run: |
echo "Running compliance check in enforcing mode..."
/scripts/gitlab.sh
###########################
# BUILD STAGE
###########################
build-kotlin:
runs-on: infra1-small
needs: compliance-check
steps:
- uses: actions/checkout@v3
- name: cache
uses: actions/cache@v3
with:
key: kotlin-build
path: .gradle
- run: |
export GRADLE_USER_HOME=`pwd`/.gradle
./gradlew clean build compileTestKotlin -x test --info
- name: Archive build outputs
uses: actions/upload-artifact@v3
with:
name: build-artifact
path: '**/build/**/*'

###########################
# TEST STAGE
###########################
test-kotlin:
runs-on: infra1-small
needs: build-kotlin
steps:
- uses: actions/checkout@v3
- name: cache
uses: actions/cache/restore@v3
with:
key: kotlin-build
path: .gradle
- run: |
export GRADLE_USER_HOME=`pwd`/.gradle
./gradlew test --info
- name: Archive test outputs
uses: actions/upload-artifact@v3
with:
name: test-artifact
path: '**/build/test-results/**/TEST-*.xml'

0 comments on commit 845c728

Please sign in to comment.