Skip to content

Commit

Permalink
fix: updated pipelines, reran documentation (#104)
Browse files Browse the repository at this point in the history
* fix: updated pipelines, reran documentation

* fix: updated goreleaser
  • Loading branch information
demeyerthom authored Sep 24, 2024
1 parent 41b6aae commit 45a5791
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 37 deletions.
25 changes: 25 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
version: 2
updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "monthly"
day: tuesday
commit-message:
prefix: "chore(deps)"
groups:
go:
patterns:
- "*"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
day: tuesday
commit-message:
prefix: "chore(deps)"
groups:
github-actions:
patterns:
- "*"
27 changes: 19 additions & 8 deletions .github/workflows/pull-requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ jobs:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.18'
- uses: actions/checkout@v3
go-version-file: go.mod

- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
Expand All @@ -23,9 +26,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.18'
go-version-file: go.mod

- run: go test -v -cover ./...

acceptance-tests:
Expand All @@ -45,22 +51,27 @@ jobs:
- '1.2.*'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.18'
go-version-file: go.mod

- uses: hashicorp/setup-terraform@v2
with:
terraform_version: ${{ matrix.terraform-version }}
terraform_wrapper: false

- name: load mock data
shell: bash
run: |
FILES="${{ github.workspace }}/mock/mappings/*"
for f in $FILES; do curl --location --request POST 'http://localhost:8080/__admin/mappings' --header 'Content-Type: application/json' --header 'Accept: application/json' --data-raw "$(cat "$f")"; done
- run: go test -v -p 1 ./...
env:
TF_ACC: '1'
COMMERCELAYER_CLIENT_ID: client-id
COMMERCELAYER_CLIENT_SECRET: client-secret
COMMERCELAYER_API_ENDPOINT: http://localhost:8080/api
COMMERCELAYER_AUTH_ENDPOINT: http://localhost:8080/oauth/token
COMMERCELAYER_AUTH_ENDPOINT: http://localhost:8080/oauth/token
32 changes: 16 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

# This GitHub action can publish assets for release when a tag is created.
# Currently its setup to run on any tag that matches the pattern "v*" (ie. v0.1.0).
# Currently, its setup to run on any tag that matches the pattern "v*" (ie. v0.1.0).
#
# This uses an action (hashicorp/ghaction-import-gpg) that assumes you set your
# private key in the `GPG_PRIVATE_KEY` secret and passphrase in the `PASSPHRASE`
Expand All @@ -15,37 +15,37 @@ on:
push:
tags:
- 'v*'

permissions:
contents: write

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
-
name: Checkout
- name: Checkout
uses: actions/checkout@v3
-
name: Unshallow

- name: Unshallow
run: git fetch --prune --unshallow
-
name: Set up Go
uses: actions/setup-go@v3

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
cache: true
-
name: Import GPG key
go-version-file: go.mod

- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v5
id: import_gpg
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PASSPHRASE }}
-
name: Run GoReleaser

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v3.1.0
with:
version: latest
args: release --rm-dist
args: release --clean
env:
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16 changes: 4 additions & 12 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
# Visit https://goreleaser.com for documentation on how to customize this
# behavior.
version: 2

before:
hooks:
# this is just an example and not a requirement for provider building/publishing
- go mod tidy
builds:
- env:
# goreleaser does not work with CGO, it could also complicate
# usage by users in CI/CD systems like Terraform Cloud where
# they are unable to install libraries.
- CGO_ENABLED=0
mod_timestamp: '{{ .CommitTimestamp }}'
flags:
Expand Down Expand Up @@ -41,11 +37,9 @@ checksum:
signs:
- artifacts: checksum
args:
# if you are using this in a GitHub action or some other automated pipeline, you
# need to pass the batch flag to indicate its not interactive.
- "--batch"
- "--local-user"
- "{{ .Env.GPG_FINGERPRINT }}" # set this environment variable for your signing key
- "{{ .Env.GPG_FINGERPRINT }}"
- "--output"
- "${signature}"
- "--detach-sign"
Expand All @@ -54,7 +48,5 @@ release:
extra_files:
- glob: 'terraform-registry-manifest.json'
name_template: '{{ .ProjectName }}_{{ .Version }}_manifest.json'
# If you want to manually examine the release before its live, uncomment this line:
# draft: true
changelog:
skip: true
disable: true
2 changes: 1 addition & 1 deletion docs/resources/inventory_model.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ Optional:
- `reference` (String) A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a InventoryModeling tool, a CRM, or whatever.
- `reference_origin` (String) Any identifier of the third party system that defines the reference code
- `stock_locations_cutoff` (Number) The maximum number of stock locations used for inventory computation
- `strategy` (String) The inventory model's shipping strategy: one between 'no_split' (default), 'split_shipments', "split_by_line_items", 'ship_from_primary' and 'ship_from_first_available_or_primary'.
- `strategy` (String) The inventory model's shipping strategy: one between 'no_split' (default), 'split_shipments', 'split_by_line_items', 'ship_from_primary' and 'ship_from_first_available_or_primary'.


0 comments on commit 45a5791

Please sign in to comment.