-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ci: update ci (#6) * fix: update ci pipelines * fix: single docker compose * fix: updated dockerfile go version * fix: append unique uuid to producer and consumer names * fix: updated dependencies * fix: updated models new producer call
- Loading branch information
Showing
15 changed files
with
287 additions
and
432 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,28 @@ | ||
name: Coverage | ||
|
||
on: | ||
workflow_run: | ||
workflows: | ||
- Build | ||
types: | ||
- completed | ||
|
||
permissions: read-all | ||
push: | ||
branches: ["main"] | ||
|
||
jobs: | ||
coverage: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: "1.20" | ||
|
||
go-version: "1.21" | ||
- name: Set up docker environment | ||
run: docker compose up -d | ||
|
||
- name: Clean | ||
run: go clean && go clean -cache | ||
- name: Test | ||
run: go test -coverpkg ./... -coverprofile coverage.txt -covermode count ./... | ||
|
||
run: go test -p 1 -count 1 -coverpkg ./... -coverprofile coverage.txt -covermode count ./... | ||
- uses: codecov/codecov-action@v3 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
files: ./coverage.txt | ||
fail_ci_if_error: true | ||
|
||
- name: Clean docker environment | ||
run: docker compose down --rmi all -v --remove-orphans | ||
run: docker compose down --rmi all -v --remove-orphans |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
|
||
jobs: | ||
versioning: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
version: ${{ steps.latest_version.outputs.version }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- id: latest_version | ||
name: Latest version | ||
run: python version.py >> $GITHUB_OUTPUT | ||
|
||
create-release: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
packages: write | ||
needs: | ||
- versioning | ||
outputs: | ||
upload_url: ${{ steps.create-release.outputs.upload_url }} | ||
steps: | ||
- name: Create Release | ||
id: create-release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ needs.versioning.outputs.version }} | ||
release_name: Release ${{ needs.versioning.outputs.version }} | ||
draft: false | ||
prerelease: false | ||
|
||
build-docker: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
needs: | ||
- versioning | ||
- create-release | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Docker image | ||
run: echo "v${{ needs.versioning.outputs.version }}" | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ghcr.io/${{ github.repository }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: . | ||
push: true | ||
tags: ghcr.io/${{ github.repository }}:latest,ghcr.io/${{ github.repository }}:${{ needs.versioning.outputs.version }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
|
||
build-release: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
packages: write | ||
needs: | ||
- create-release | ||
strategy: | ||
matrix: | ||
os: [linux] | ||
arch: [amd64, "386"] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.21' | ||
- name: Prepare bin directory | ||
run: mkdir -p bin | ||
- name: Generate asset name | ||
id: gen-asset-name | ||
run: echo filename=${{ github.event.repository.name }}.${{ matrix.os }}.${{ matrix.arch }}$(python -c "import os; print('.exe' if os.getenv('GOOS') == 'windows' else '', end='')") >> $GITHUB_OUTPUT | ||
- name: Build binary | ||
run: go build -v -o bin/${{ steps.gen-asset-name.outputs.filename }} | ||
env: | ||
GOOS: ${{ matrix.os }} | ||
GOARCH: ${{ matrix.arch }} | ||
- name: UPX | ||
run: upx bin/* | ||
- name: Upload Binary to Release | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ needs.create-release.outputs.upload_url }} | ||
asset_path: ./bin/${{ steps.gen-asset-name.outputs.filename }} | ||
asset_name: ${{ steps.gen-asset-name.outputs.filename }} | ||
asset_content_type: application/octet-stream |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Tagging | ||
|
||
on: | ||
push: | ||
branches: ["dev"] | ||
|
||
jobs: | ||
tagging: | ||
permissions: | ||
contents: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup node 18.x | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.x | ||
cache: "npm" | ||
- name: Git Identity | ||
run: | | ||
git checkout dev | ||
git fetch --all --tags | ||
git config --global user.email "antoniojosedonishung@gmail.com" | ||
git config --global user.name "Antonio Donis" | ||
- name: Changelog | ||
run: 'npx standard-version --message "[ci skip] chore(release): %s"' | ||
- name: Push changes | ||
run: git push --follow-tags --force origin dev |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Test | ||
|
||
on: | ||
pull_request: | ||
branches: ["dev"] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: "1.21" | ||
- name: Clean | ||
run: go clean && go clean -cache | ||
- name: Build | ||
run: go build . | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: "1.21" | ||
- name: Set up docker environment | ||
run: docker compose up -d | ||
- name: Clean | ||
run: go clean && go clean -cache | ||
- name: Test | ||
run: go test -p 1 -count 1 -v ./... | ||
- name: Clean docker environment | ||
run: docker compose down --rmi all -v --remove-orphans |
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
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
Oops, something went wrong.