Skip to content

Commit

Permalink
chore: Add build action on main branch and pull requests
Browse files Browse the repository at this point in the history
  • Loading branch information
guilgaly committed Jul 16, 2024
1 parent 0dcc2ca commit 038d1dd
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 12 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Build

on:
push:
branches:
- main
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

defaults:
run:
shell: bash

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 10
env:
JAVA_OPTS: "-Xmx4G"
SBT_OPTS: "-Dsbt.ci=true"
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '21'

- name: Build JVM projects
working-directory: ./jvm
run: sbt gatling-jvm-to-js-adapter/spotlessCheck gatling-jvm-to-js-adapter/compile gatling-jvm-to-js-adapter/test

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20

- name: Build JS projects
working-directory: ./js
run: |
npm ci
npm run format-check --workspaces
npm run build --workspaces
3 changes: 2 additions & 1 deletion js/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"scripts": {
"clean": "rimraf target",
"format": "prettier --write '**/*.ts'",
"format-check": "prettier --check '**/*.ts'",
"build": "tsc -p . && chmod +x ./target/index.js"
}
}
}
1 change: 1 addition & 0 deletions js/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"scripts": {
"clean": "rimraf target",
"format": "prettier --write '**/*.ts'",
"format-check": "prettier --check '**/*.ts'",
"test": "jest",
"build": "tsc -p ."
}
Expand Down
1 change: 1 addition & 0 deletions js/http/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"scripts": {
"clean": "rimraf target",
"format": "prettier --write '**/*.ts'",
"format-check": "prettier --check '**/*.ts'",
"test": "jest",
"build": "tsc -p ."
}
Expand Down
3 changes: 2 additions & 1 deletion js/jvm-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"scripts": {
"clean": "rm -f ./index.js ./index.d.ts",
"format": "prettier --write 'gatling.d.ts' 'index.ts'",
"format-check": "prettier --check 'gatling.d.ts' 'index.ts'",
"build": "tsc -p ."
}
}
}
20 changes: 10 additions & 10 deletions jvm/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,16 @@ lazy val adapter = (project in file("adapter"))
val jsAdapterVersion = version.value
val content =
s"""export const versions = {
| graalvm: {
| jdk: "$graalvmJdkVersion",
| js: "$graalvmJsVersion"
| },
| coursier: "$coursierVersion",
| gatling: {
| core: "$gatlingVersion",
| enterprisePluginCommons: "$gatlingEnterpriseComponentPluginVersion",
| jsAdapter: "$jsAdapterVersion"
| }
| graalvm: {
| jdk: "$graalvmJdkVersion",
| js: "$graalvmJsVersion"
| },
| coursier: "$coursierVersion",
| gatling: {
| core: "$gatlingVersion",
| enterprisePluginCommons: "$gatlingEnterpriseComponentPluginVersion",
| jsAdapter: "$jsAdapterVersion"
| }
|};
|""".stripMargin
IO.write(path, content)
Expand Down

0 comments on commit 038d1dd

Please sign in to comment.