From 720d4a318f518225924fd93b6590045d046f1dbd Mon Sep 17 00:00:00 2001 From: JP Ungaretti Date: Fri, 8 Sep 2023 15:27:35 -0700 Subject: [PATCH 1/3] Add make test commands --- Makefile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Makefile b/Makefile index c27820c..9b01c9a 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,12 @@ build: go build -o bin/bacon . +test-unit: + go test ./... + +test-system: build + git submodule update --init + ./test/bats/bin/bats test/test.bats + clean: rm -rf bin From 6ac83dc16b8f576f7e05ba52cea2e834bb666d5e Mon Sep 17 00:00:00 2001 From: JP Ungaretti Date: Fri, 8 Sep 2023 15:27:48 -0700 Subject: [PATCH 2/3] Add test directions to README --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index 99a1fd0..031081b 100644 --- a/README.md +++ b/README.md @@ -104,6 +104,23 @@ records: - `domain` - `records` +## Contributing + +PRs that add new DNS providers or address [open issues](https://github.com/jungaretti/bacon/issues) are always welcome. + +### Development + +```bash +# Build Bacon +make build + +# Run unit tests +make test-unit + +# Run system tests (auth required) +make test-system +``` + ## Built With - [Cobra](https://cobra.dev/) From d3941d263b13f0c6004828dc8477e352f58822eb Mon Sep 17 00:00:00 2001 From: JP Ungaretti Date: Fri, 8 Sep 2023 15:28:31 -0700 Subject: [PATCH 3/3] Use make commands in workflows --- .github/workflows/test-integration.yml | 2 +- .github/workflows/test-pr.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-integration.yml b/.github/workflows/test-integration.yml index 5632389..17eb0af 100644 --- a/.github/workflows/test-integration.yml +++ b/.github/workflows/test-integration.yml @@ -14,7 +14,7 @@ jobs: - uses: actions/checkout@v3 with: submodules: true - - run: ./test/bats/bin/bats test/test.bats + - run: make test-system env: PORKBUN_API_KEY: ${{ secrets.PORKBUN_API_KEY }} PORKBUN_SECRET_KEY: ${{ secrets.PORKBUN_SECRET_KEY }} diff --git a/.github/workflows/test-pr.yml b/.github/workflows/test-pr.yml index 3b3cea5..f334e58 100644 --- a/.github/workflows/test-pr.yml +++ b/.github/workflows/test-pr.yml @@ -12,4 +12,4 @@ jobs: with: go-version: '1.19' - uses: actions/checkout@v3 - - run: go test ./... + - run: make test-unit