-
Notifications
You must be signed in to change notification settings - Fork 55
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 #3428 from hashicorp/data-api-v2-github-action
dataapiv2 - Add github actions to dataapiv2
- Loading branch information
Showing
5 changed files
with
59 additions
and
2 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,27 @@ | ||
--- | ||
name: Verify Data API V2 API Definitions Can be Mapped | ||
on: | ||
pull_request: | ||
types: ['opened', 'synchronize'] | ||
paths: | ||
- '.github/workflows/**' | ||
- 'tools/data-api/**' | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: true | ||
steps: | ||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
with: | ||
submodules: recursive | ||
|
||
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0 | ||
with: | ||
go-version: '1.21.3' | ||
|
||
- name: run unit tests | ||
run: | | ||
cd ./tools/data-api | ||
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 |
---|---|---|
|
@@ -9,4 +9,7 @@ fmt: | |
run: build | ||
./data-api serve | ||
|
||
test: build | ||
go test -v ./... | ||
|
||
.PHONY: build fmt run |
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,27 @@ | ||
package repositories | ||
|
||
import ( | ||
"testing" | ||
) | ||
|
||
func TestServices_ResourceManager(t *testing.T) { | ||
repo, err := NewServicesRepository("../../../../api-definitions/", ResourceManagerServiceType, nil) | ||
if err != nil { | ||
t.Fatalf(err.Error()) | ||
} | ||
|
||
if _, err := repo.GetAll(ResourceManagerServiceType); err != nil { | ||
t.Fatalf(err.Error()) | ||
} | ||
} | ||
|
||
func TestServices_MicrosoftGraph(t *testing.T) { | ||
repo, err := NewServicesRepository("../../../../api-definitions/", MicrosoftGraphV1StableServiceType, nil) | ||
if err != nil { | ||
t.Fatalf(err.Error()) | ||
} | ||
|
||
if _, err := repo.GetAll(MicrosoftGraphV1StableServiceType); err != nil { | ||
t.Fatalf(err.Error()) | ||
} | ||
} |
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