Skip to content

Commit

Permalink
change workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Ghazaryan authored and Martin Ghazaryan committed May 25, 2022
1 parent 713c088 commit 970c646
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 34 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build and publish xk6-mongo

on:
push:
tags:
- "v*"
jobs:
build:
name: Build xk6-mongo
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Build 🏗️
id: build
uses: szkiba/xk6bundler@v0
with:
platform: linux/amd64 windows/amd64 darwin/amd64
with: |
github.com/GhMartingit/xk6-mongo@${{ github.ref_name }}
- name: Install Go 🧑‍💻
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: actions/setup-go@v3
with:
go-version: '1.18'

- name: Generate CycloneDX SBOM artifacts 📃
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
run: |
go install github.com/CycloneDX/cyclonedx-gomod/cmd/cyclonedx-gomod@latest
cyclonedx-gomod mod -json -licenses -output cyclonedx-xk6-mongo-${{ github.ref_name }}.json
- name: Upload CycloneDX SBOM artifact for go.mod 💾
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: actions/upload-artifact@v3
with:
name: cyclonedx-xk6-mongo-${{ github.ref_name }}.json
path:
cyclonedx-xk6-mongo-${{ github.ref_name }}.json

- name: Create Release 📦
uses: softprops/action-gh-release@v1
with:
files: dist/*.tar.gz
31 changes: 0 additions & 31 deletions .github/workflows/release.yml

This file was deleted.

5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
FROM golang:1.17-alpine as builder
FROM golang:1.18-alpine as builder
WORKDIR $GOPATH/src/go.k6.io/k6
ADD . .
RUN apk --no-cache add openssh-client git
RUN CGO_ENABLED=0 go install -a -trimpath -ldflags "-s -w -X go.k6.io/k6/lib/consts.VersionDetails=$(date -u +"%FT%T%z")/$(git describe --always --long --dirty)"
RUN go install -trimpath go.k6.io/xk6/cmd/xk6@latest
RUN --mount=type=ssh xk6 build \
--with github.com/mostafa/xk6-kafka@latest \
--with github.com/GhMartingit/xk6-mongo
--with github.com/GhMartingit/xk6-mongo@latest
RUN cp k6 $GOPATH/bin/k6

FROM alpine:3.14
Expand Down
2 changes: 1 addition & 1 deletion test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default ()=> {
let doc = {
correlationId: `test--mongodb`,
title: 'Perf test experiment',
url: 'biotronik.com',
url: 'example.com',
locale: 'en',
time: `${new Date(Date.now()).toISOString()}`
};
Expand Down

0 comments on commit 970c646

Please sign in to comment.