diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 9bef3d4c..52e87704 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -22,6 +22,13 @@ updates: schedule: interval: daily + - package-ecosystem: gomod + directory: /provider/appconfig + labels: + - Skip-Changelog + schedule: + interval: daily + - package-ecosystem: github-actions directory: / labels: diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 96c08257..ccb5d2b8 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -9,6 +9,9 @@ on: jobs: benchmark: + strategy: + matrix: + module: [ '', 'provider/file', 'provider/pflag', 'provider/appconfig' ] name: Benchmark runs-on: ubuntu-latest steps: @@ -18,10 +21,5 @@ jobs: go-version: 'stable' cache-dependency-path: "**/go.sum" - name: Benchmark - run: go test -v -shuffle=on -bench=. ./... - - name: Benchmark (file) run: go test -v -bench=. ./... - working-directory: provider/file - - name: Benchmark (pflag) - run: go test -v -shuffle=on -bench=. ./... - working-directory: provider/pflag + working-directory: ${{ matrix.module }} diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index e852243d..96aa829a 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -9,6 +9,10 @@ on: jobs: coverage: + benchmark: + strategy: + matrix: + module: [ '', 'provider/file', 'provider/pflag', 'provider/appconfig' ] name: Coverage runs-on: ubuntu-latest steps: @@ -19,11 +23,4 @@ jobs: cache-dependency-path: "**/go.sum" - name: Coverage run: go test -v -covermode=count -coverprofile=coverage.txt ./... - - name: Coverage (file) - run: go test -v -covermode=count -coverprofile=coverage.txt ./... - working-directory: provider/file - - name: Coverage (pflag) - run: go test -v -covermode=count -coverprofile=coverage.txt ./... - working-directory: provider/pflag - - name: Codecov - uses: codecov/codecov-action@v4 + working-directory: ${{ matrix.module }} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 4def668f..3810746c 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -9,6 +9,10 @@ on: jobs: lint: + benchmark: + strategy: + matrix: + module: [ '', 'provider/file', 'provider/pflag', 'provider/appconfig' ] name: Lint runs-on: ubuntu-latest steps: @@ -19,11 +23,5 @@ jobs: cache-dependency-path: "**/go.sum" - name: Lint uses: golangci/golangci-lint-action@v3 - - name: Lint (file) - uses: golangci/golangci-lint-action@v3 - with: - working-directory: provider/file - - name: Lint (pflag) - uses: golangci/golangci-lint-action@v3 with: - working-directory: provider/pflag + working-directory: ${{ matrix.module }} diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml index b11b3cc1..a8901fed 100644 --- a/.github/workflows/tag.yml +++ b/.github/workflows/tag.yml @@ -10,7 +10,7 @@ jobs: tag: strategy: matrix: - module: [ 'provider/file', 'provider/pflag' ] + module: [ 'provider/file', 'provider/pflag', 'provider/appconfig' ] name: Submodules runs-on: ubuntu-latest steps: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2d52ebdf..df0d20cc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,6 +11,7 @@ jobs: test: strategy: matrix: + module: [ '', 'provider/file', 'provider/pflag', 'provider/appconfig' ] run-on: [ 'ubuntu', 'macOS', 'windows' ] go-version: [ 'stable' ] name: Test @@ -23,20 +24,10 @@ jobs: cache-dependency-path: "**/go.sum" - name: Race Test run: go test -v -shuffle=on -count=10 -race ./... + working-directory: ${{ matrix.module }} - name: Test - run: go test -v -shuffle=on ./... - - name: Race Test (file) - run: go test -v -shuffle=on -count=10 -race ./... - working-directory: provider/file - - name: Test (file) run: go test -v ./... - working-directory: provider/file - - name: Race Test (pflag) - run: go test -v -shuffle=on -count=10 -race ./... - working-directory: provider/pflag - - name: Test (pflag) - run: go test -v -shuffle=on ./... - working-directory: provider/pflag + working-directory: ${{ matrix.module }} all: if: ${{ always() }} runs-on: ubuntu-latest diff --git a/README.md b/README.md index c15be1c3..5d4cd313 100644 --- a/README.md +++ b/README.md @@ -95,6 +95,7 @@ There are providers for the following configuration sources: - [`file`](provider/file) loads configuration from a file. - [`flag`](provider/flag) loads configuration from flags. - [`pflag`](provider/pflag) loads configuration from [spf13/pflag](https://github.com/spf13/pflag). +- [`appconfig`](provider/appconfig) loads configuration from [AWS AppConfig](https://aws.amazon.com/systems-manager/features/appconfig). ## Inspiration diff --git a/provider/appconfig/go.mod b/provider/appconfig/go.mod new file mode 100644 index 00000000..4d8dba38 --- /dev/null +++ b/provider/appconfig/go.mod @@ -0,0 +1,3 @@ +module github.com/nil-go/konf/provider/appconfig + +go 1.21 diff --git a/provider/pflag/go.mod b/provider/pflag/go.mod index 2f38ab4e..7248789d 100644 --- a/provider/pflag/go.mod +++ b/provider/pflag/go.mod @@ -1,5 +1,5 @@ module github.com/nil-go/konf/provider/pflag -go 1.19 +go 1.21 require github.com/spf13/pflag v1.0.5