Skip to content

Merge branch 'ci-setup' of https://github.com/aabbcc33/skipass into c… #45

Merge branch 'ci-setup' of https://github.com/aabbcc33/skipass into c…

Merge branch 'ci-setup' of https://github.com/aabbcc33/skipass into c… #45

Workflow file for this run

name: CI
on:
push:
branches:
- main
- ci-setup
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{github.repository}}
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Change wrapper permissions
working-directory: ./PostManagement
run: chmod +x ./gradlew
- name: build PostService
working-directory: ./PostManagement
run: ./gradlew test -i
codacy-security-scan:
permissions:
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
name: Codacy Security Scan
runs-on: ubuntu-latest
steps:
# Checkout the repository to the GitHub Actions runner
- name: Checkout code
uses: actions/checkout@v3
# Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis
- name: Run Codacy Analysis CLI
uses: codacy/codacy-analysis-cli-action@d840f886c4bd4edc059706d09c6a1586111c540b
with:
# Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository
# You can also omit the token and run the tools that support default configurations
project-token: ${{ secrets.CODACY_TOKEN }}
verbose: true
output: results.sarif
format: sarif
# Adjust severity of non-security issues
gh-code-scanning-compat: true
# Force 0 exit code to allow SARIF file generation
# This will handover control about PR rejection to the GitHub side
max-allowed-issues: 2147483647
# Upload the SARIF file generated in the previous step
- name: Upload SARIF results file
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: results.sarif
build:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- dockerfile: ./UserService/Dockerfile
image: ghcr.io/AleksandraKrasteva/user-service
working-directory: ./UserService
- dockerfile: ./JourneyService/Dockerfile
image: ghcr.io/AleksandraKrasteva/journey-service
working-directory: ./JourneyService
- dockerfile: ./PostManagement/Dockerfile
image: ghcr.io/AleksandraKrasteva/post-service
working-directory: ./PostManagement
- dockerfile: ./StatisticsService/Dockerfile
image: ghcr.io/AleksandraKrasteva/statistics-service
working-directory: ./StatisticsService
- dockerfile: ./client/Dockerfile
image: ghcr.io/AleksandraKrasteva/client
working-directory: ./client
- dockerfile: ./Dockerfile
image: ghcr.io/AleksandraKrasteva/rabbitmq
working-directory: ./
permissions:
contents: read
packages: write
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Log in Docker GitHub Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{matrix.image}}
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Build and push images from matrix
uses: docker/build-push-action@v5
with:
context: ${{matrix.working-directory}}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}