Merge branch 'incentro-ecx:main' into main #15
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: [push] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
services: | |
commercelayer-mock: | |
image: wiremock/wiremock:2.34.0 | |
ports: | |
- "8080:8080" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: hashicorp/setup-terraform@v3 | |
with: | |
terraform_version: 1.3.7 | |
terraform_wrapper: false | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: go.mod | |
- name: Set up Task | |
uses: arduino/setup-task@v2 | |
with: | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: golangci-lint | |
continue-on-error: true | |
uses: golangci/golangci-lint-action@v6 | |
with: | |
args: --issues-exit-code=0 --timeout=5m | |
- 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 | |
- name: Run tests | |
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 | |
- name: Upload to codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
verbose: true | |
- name: build binary | |
uses: goreleaser/goreleaser-action@v6 | |
with: | |
args: build --snapshot --clean --single-target | |
env: | |
GOPATH: ${{ env.GOPATH }} | |
changie: | |
runs-on: ubuntu-latest | |
needs: test | |
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' | |
permissions: | |
contents: write | |
pull-requests: write | |
actions: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Prepare release | |
uses: labd/[email protected] | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
release-workflow: 'release.yaml' |