-
Notifications
You must be signed in to change notification settings - Fork 2
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
1 parent
f942351
commit 04e0ae4
Showing
8 changed files
with
228 additions
and
7 deletions.
There are no files selected for viewing
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,76 @@ | ||
name: Build agents | ||
on: | ||
push: | ||
branches: [main, "*"] | ||
|
||
jobs: | ||
testDiscoveryAgent: | ||
uses: ./.github/workflows/run-da-tests.yml | ||
|
||
testTraceabilityAgent: | ||
uses: ./.github/workflows/run-ta-tests.yml | ||
|
||
buildDiscoveryAgent: | ||
needs: testDiscoveryAgent | ||
env: | ||
GOFLAGS: "-mod=mod" | ||
GOWORK: "off" | ||
defaults: | ||
run: | ||
working-directory: ${{ env.GOPATH }}/discovery | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.21 | ||
|
||
- name: Build discovery agent | ||
working-directory: discovery | ||
run: | | ||
git fetch --all --tags --quiet | ||
git branch --show-current > commit_id | ||
git tag -l --sort='version:refname' | grep -Eo '[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,3}$' | tail -1 > version | ||
make build | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: apigee_discovery_agent | ||
path: discovery/bin/apigee_discovery_agent | ||
|
||
buildTraceabilityAgent: | ||
needs: testTraceabilityAgent | ||
env: | ||
GOFLAGS: "-mod=mod" | ||
GOWORK: "off" | ||
defaults: | ||
run: | ||
working-directory: ${{ env.GOPATH }}/traceability | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.21 | ||
|
||
- name: Build traceability agent | ||
working-directory: traceability | ||
run: | | ||
git fetch --all --tags --quiet | ||
git branch --show-current > commit_id | ||
git tag -l --sort='version:refname' | grep -Eo '[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,3}$' | tail -1 > version | ||
make build | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: apigee_traceability_agent | ||
path: traceability/bin/apigee_traceability_agent | ||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: apigee_traceability_agent.yml | ||
path: traceability/apigee_traceability_agent.yml |
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 |
---|---|---|
|
@@ -3,7 +3,7 @@ name: Discovery Agent Docker | |
on: | ||
push: | ||
tags: | ||
- "*" | ||
- "*xxx" | ||
|
||
jobs: | ||
buildDiscoveryAgentDocker: | ||
|
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
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 |
---|---|---|
|
@@ -3,7 +3,7 @@ name: Traceability Agent Docker | |
on: | ||
push: | ||
tags: | ||
- "*" | ||
- "*xxx" | ||
|
||
jobs: | ||
buildtraceabilityAgentDocker: | ||
|
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
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,94 @@ | ||
name: Discovery Agent Docker | ||
|
||
on: | ||
push: | ||
tags: | ||
- "*" | ||
|
||
jobs: | ||
testDiscoveryAgent: | ||
uses: ./.github/workflows/run-da-tests.yml | ||
|
||
testTraceabilityAgent: | ||
uses: ./.github/workflows/run-ta-tests.yml | ||
|
||
buildDiscoveryAgentDocker: | ||
needs: testDiscoveryAgent | ||
env: | ||
GOFLAGS: "-mod=mod" | ||
GOWORK: "off" | ||
IMAGE_NAME: apigee_discovery_agent | ||
ORG_NAME: Axway | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Create commit_id & version files | ||
working-directory: discovery | ||
run: | | ||
git branch --show-current > commit_id | ||
echo "${{ github.ref_name }}" > version | ||
- name: Log in to the Container registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
flavor: latest=false | ||
images: ghcr.io/${{ env.ORG_NAME }}/${{ env.IMAGE_NAME }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: discovery/docker/Dockerfile | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
|
||
|
||
buildtraceabilityAgentDocker: | ||
needs: testTraceabilityAgent | ||
env: | ||
GOFLAGS: "-mod=mod" | ||
GOWORK: "off" | ||
IMAGE_NAME: apigee_traceability_agent | ||
ORG_NAME: Axway | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Create commit_id & version files | ||
working-directory: traceability | ||
run: | | ||
git branch --show-current > commit_id | ||
echo "${{ github.ref_name }}" > version | ||
- name: Log in to the Container registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
flavor: latest=false | ||
images: ghcr.io/${{ env.ORG_NAME }}/${{ env.IMAGE_NAME }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: traceability/docker/Dockerfile | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
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,26 @@ | ||
# This action is shared by workflows that want to run the unit tests | ||
name: Test the agents | ||
|
||
on: | ||
workflow_call | ||
|
||
jobs: | ||
testDiscoveryAgent: | ||
env: | ||
GOFLAGS: "-mod=mod" | ||
GOWORK: "off" | ||
defaults: | ||
run: | ||
working-directory: ${{ env.GOPATH }}/discovery | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.21 | ||
|
||
- name: Test discovery agent | ||
working-directory: discovery | ||
run: make test |
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,26 @@ | ||
# This action is shared by workflows that want to run the unit tests | ||
name: Test the agents | ||
|
||
on: | ||
workflow_call | ||
|
||
jobs: | ||
testTraceabilityAgent: | ||
env: | ||
GOFLAGS: "-mod=mod" | ||
GOWORK: "off" | ||
defaults: | ||
run: | ||
working-directory: ${{ env.GOPATH }}/traceability | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.21 | ||
|
||
- name: Test traceability agent | ||
working-directory: traceability | ||
run: make test |