Skip to content

Commit

Permalink
Merge pull request #127 from grafana/chore/fix-gh-actions
Browse files Browse the repository at this point in the history
[fix] Update git actions
  • Loading branch information
w1kman authored Oct 6, 2023
2 parents 1d555ee + 5555424 commit f8d480a
Show file tree
Hide file tree
Showing 9 changed files with 24,488 additions and 7,498 deletions.
24 changes: 9 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,23 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v1
env:
cache-name: node-modules
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
node-version: '16'
cache: 'npm'

- name: Install dependencies
run: yarn
run: npm ci

- name: Lint
run: yarn lint
- name: Lint files
run: npm run lint

- name: Bundle
run: yarn bundle
run: npm run bundle

- name: Test
run: yarn test
run: npm test

- name: Build Docker Image
run: |
Expand Down
43 changes: 31 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,38 @@ name: Release
on:
push:
tags:
- v*
- 'v[0-9]+.[0-9]+.[0-9]+'
jobs:
build-on-tag:
publish:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Use Node.js 12.xs
uses: actions/setup-node@v1
- name: Setup environment
uses: actions/setup-node@v3
with:
node-version: '12.x'
node-version: '16'
registry-url: 'https://registry.npmjs.org'
cache: 'npm'

- name: Install dependencies
run: yarn install
run: npm ci

- name: Lint
run: yarn lint
- name: Lint files
run: npm run lint

- name: Test
run: yarn test
run: npm test

- name: Bundle
run: yarn bundle
run: npm run bundle

- name: Publish to NPM
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish

- name: Build docker image
run: |
Expand All @@ -48,3 +49,21 @@ jobs:
grafana/har-to-k6:latest
docker push grafana/har-to-k6:$tag
docker push grafana/har-to-k6:latest
create-github-release:
name: Create GitHub Release
runs-on: ubuntu-latest
needs: publish
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Create Release Notes
uses: actions/[email protected]
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
await github.request(`POST /repos/${{ github.repository }}/releases`, {
tag_name: "${{ github.ref }}",
generate_release_notes: true
});
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
npm-debug.log
package-lock.json
.bundle
NERD_*
tmp
Expand Down Expand Up @@ -38,3 +37,4 @@ loadtest.js

yarn-error.log
.idea
yarn.lock
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
12.18.0
v16
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM node:12-slim
FROM node:16-slim

WORKDIR /converter

COPY . .

RUN yarn
RUN yarn bundle
RUN npm install
RUN npm run bundle

ENTRYPOINT ["node", "bin/har-to-k6.js"]
Loading

0 comments on commit f8d480a

Please sign in to comment.