This repository has been archived by the owner on Nov 30, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from eclipse-pass/215-gh-actions-test
Initial gh actions for Go
- Loading branch information
Showing
3 changed files
with
67 additions
and
0 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,21 @@ | ||
name: pass-docker-services Continuous Integration | ||
on: [ pull_request, workflow_dispatch ] | ||
|
||
concurrency: | ||
group: ci-${{ github.head_ref || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
print-workflow-description: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: echo "This is a CI build of branch ${{ github.ref }} in repository ${{ github.repository }}" | ||
- run: echo "This job was triggered by a ${{ github.event_name }} event and is running on a ${{ runner.os }} server" | ||
|
||
call-tests-unit: | ||
name: Run Unit Tests | ||
uses: eclipse-pass/pass-policy-service/.github/workflows/tests-unit.yml@main | ||
|
||
call-tests-integration: | ||
name: Run Integration Tests | ||
uses: eclipse-pass/pass-policy-service/.github/workflows/tests-integration.yml@main |
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,28 @@ | ||
name: Run Integration Tests | ||
on: | ||
workflow_call | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout the repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: '>=1.17.0' | ||
|
||
- name: Docker pull | ||
run: docker-compose pull | ||
|
||
- name: Start containers | ||
run: docker-compose up -d | ||
|
||
- name: Run Integration Tests | ||
run: go test -tags=integration ./... | ||
|
||
- name: Stop containers | ||
if: always() | ||
run: docker-compose -f "docker-compose.yml" down |
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,18 @@ | ||
name: Run Unit Tests | ||
on: | ||
workflow_call | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout the repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: '>=1.17.0' | ||
|
||
- name: Run Unit Tests | ||
run: go test ./... |