Merge pull request #84 from Arc-E-Tect/refresh-versions #36
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build of Master | |
on: | |
push: | |
branches: | |
- 'master' | |
paths-ignore: | |
- '.github/badges/**' | |
- '.idea/**' | |
- '.github/workflows/nigthly**' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Validate Gradle wrapper | |
uses: gradle/wrapper-validation-action@v1 | |
- name: Cache Gradle packages | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' # See 'Supported distributions' for available options | |
java-version: '17' | |
- name: Expose git commit data | |
uses: rlespinasse/[email protected] | |
- name: Prepare Gradle | |
run: | | |
chmod +x ./gradlew | |
./gradlew clean | |
- name: Build with Gradle | |
run: | | |
./gradlew build asciidoctor openapi3 postman | |
- name: Push changes back to origin | |
run: | | |
git push origin --tags | |
git push origin --all --force | |
- name: Show version information | |
run: | | |
./gradlew printVersion | |
- name: Upload bootJar | |
uses: actions/upload-artifact@v2 | |
with: | |
name: Arc-E-Tect_Phonebook-Microservice | |
path: build/libs | |
- name: Upload Documentation | |
uses: actions/upload-artifact@v2 | |
with: | |
name: API-documentation | |
path: | | |
build/docs | |
build/api-spec | |
- name: Upload Test Reports | |
uses: actions/upload-artifact@v2 | |
with: | |
name: test-reports | |
path: build/reports/tests | |
- name: Generate Jacoco Badge | |
id: jacoco | |
uses: cicirello/[email protected] | |
with: | |
jacoco-csv-file: build/reports/jacoco/jacoco.csv | |
- name: Commit JaCoCo badge | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: Apply CI initiated changes | |
file_pattern: .github/badges/* | |
- name: Log coverage percentage | |
run: | | |
echo "coverage = ${{ steps.jacoco.outputs.coverage }}" | |
- name: Upload Jacoco coverage report | |
uses: actions/upload-artifact@v2 | |
with: | |
name: jacoco-report | |
path: build/reports/jacoco | |
security-scan: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Validate Gradle wrapper | |
uses: gradle/wrapper-validation-action@v1 | |
- name: Cache Gradle packages | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' # See 'Supported distributions' for available options | |
java-version: '17' | |
- name: Expose git commit data | |
uses: rlespinasse/[email protected] | |
- name: Prepare Gradle | |
run: | | |
chmod +x ./gradlew | |
./gradlew clean | |
- name: Check dependencies for vulnerabilities | |
run: | | |
./gradlew dependencyCheckAnalyze | |
- name: Push changes back to origin | |
run: | | |
git push origin --tags | |
git push origin --all --force | |