This repository has been archived by the owner on Nov 22, 2024. It is now read-only.
fix: updated pipelines, reran documentation #111
Workflow file for this 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
name: run tests | |
on: | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
linting: | |
name: lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: go.mod | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v3 | |
with: | |
args: --issues-exit-code=0 --timeout=3m --verbose | |
unit-tests: | |
name: unit-tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: go.mod | |
- run: go test -v -cover ./... | |
acceptance-tests: | |
name: acceptance-tests (terraform ${{ matrix.terraform-version }}) | |
runs-on: ubuntu-latest | |
services: | |
commercelayer-mock: | |
image: wiremock/wiremock:2.34.0 | |
ports: | |
- "8080:8080" | |
strategy: | |
fail-fast: false | |
matrix: | |
terraform-version: | |
- '1.0.*' | |
- '1.1.*' | |
- '1.2.*' | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
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 |