-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
167 additions
and
192 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
name: docker | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event_name == 'push' && github.run_number || github.event.pull_request.number }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
docker: | ||
name: Build Docker image | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
app: | ||
- synchronizer | ||
- proxy | ||
fips_mode: | ||
- enabled | ||
- disabled | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
with: | ||
platforms: amd64,arm64 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to Artifactory | ||
if: ${{ github.event_name == 'push' }} | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: splitio-docker.jfrog.io | ||
username: ${{ secrets.ARTIFACTORY_DOCKER_USER }} | ||
password: ${{ secrets.ARTIFACTORY_DOCKER_PASS }} | ||
|
||
- name: Get version | ||
run: echo "VERSION=$(awk '/^const Version/{gsub(/"/, "", $4); print $4}' splitio/version.go)" >> $GITHUB_ENV | ||
|
||
- name: Docker Build and Push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: docker/Dockerfile.${{ matrix.app }} | ||
push: ${{ github.event_name == 'push' }} | ||
tags: splitio-docker.jfrog.io/split-${{ matrix.app }}${{ matrix.fips_mode == 'enabled' && '-fips' || ''}}:${{ env.VERSION }},splitio-docker.jfrog.io/split-${{ matrix.app }}${{ matrix.fips_mode == 'enabled' && '-fips' || '' }}:latest | ||
build-args: | | ||
FIPS_MODE=${{ matrix.fips_mode }} | ||
lacework: | ||
name: Scan Docker image | ||
if: ${{ github.event_name == 'pull_request' }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
app: | ||
- synchronizer | ||
- proxy | ||
fips_mode: | ||
- enabled | ||
- disabled | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Get version | ||
run: echo "VERSION=$(awk '/^const Version/{gsub(/"/, "", $4); print $4}' splitio/version.go)" >> $GITHUB_ENV | ||
|
||
- name: Docker Build and Push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: docker/Dockerfile.${{ matrix.app }} | ||
push: false | ||
tags: splitio-docker.jfrog.io/split-${{ matrix.app }}${{ matrix.fips_mode == 'enabled' && '-fips' || ''}}:${{ env.VERSION }} | ||
build-args: | | ||
FIPS_MODE=${{ matrix.fips_mode }} | ||
- name: Scan container using Lacework | ||
uses: lacework/lw-scanner-action@v1.4.1 | ||
with: | ||
LW_ACCOUNT_NAME: ${{ secrets.LW_ACCOUNT_NAME }} | ||
LW_ACCESS_TOKEN: ${{ secrets.LW_ACCESS_TOKEN }} | ||
IMAGE_NAME: splitio-docker.jfrog.io/split-${{ matrix.app }}${{ matrix.fips_mode == 'enabled' && '-fips' || ''}} | ||
IMAGE_TAG: ${{ env.VERSION }} | ||
SAVE_RESULTS_IN_LACEWORK: true |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: test | ||
|
||
on: | ||
pull_request: | ||
branches-ignore: | ||
- none | ||
|
||
jobs: | ||
build-and-test: | ||
name: Build and run tests | ||
runs-on: ubuntu-latest | ||
services: | ||
redis: | ||
image: redis | ||
ports: | ||
- 6379:6379 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: '^1.13.1' | ||
|
||
- name: Get version | ||
run: echo "VERSION=$(awk '/^const Version/{gsub(/"/, "", $4); print $4}' splitio/version.go)" >> $GITHUB_ENV | ||
|
||
- name: Run test | ||
run: make test_coverage | ||
|
||
- name: Create build folder | ||
run: mkdir -p build | ||
|
||
- name: Build assets | ||
run: make release_assets | ||
|
||
- name: SonarQube Scan (Pull Request) | ||
uses: SonarSource/sonarcloud-github-action@v2 | ||
env: | ||
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }} | ||
with: | ||
projectBaseDir: . | ||
args: > | ||
-Dsonar.host.url=${{ secrets.SONARQUBE_HOST }} | ||
-Dsonar.projectVersion=${{ env.VERSION }} | ||
-Dsonar.pullrequest.key=${{ github.event.pull_request.number }} | ||
-Dsonar.pullrequest.branch=${{ github.event.pull_request.head.ref }} | ||
-Dsonar.pullrequest.base=${{ github.event.pull_request.base.ref }} |
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