From e0c34282098a80cc6f4e567365a8d13b59f97bc9 Mon Sep 17 00:00:00 2001 From: Andrei Dreyer Date: Mon, 27 May 2024 12:57:29 +0200 Subject: [PATCH 1/5] [workflows] added release and pr workflow --- .github/workflows/pr.yaml | 43 ++++++++++++++++++++++++++ .github/workflows/release.yaml | 56 ++++++++++++++++++++++++++++++++++ 2 files changed, 99 insertions(+) create mode 100644 .github/workflows/pr.yaml create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml new file mode 100644 index 0000000..b05a6dd --- /dev/null +++ b/.github/workflows/pr.yaml @@ -0,0 +1,43 @@ +name: pr +on: pull_request +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 1 + - name: Set up JDK + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '21' + - uses: actions/cache@v4 + with: + path: | + ~/.sbt + ~/.coursier + key: ${{ runner.os }}-sbt-${{ hashfiles('**/build.sbt') }} + - name: Compile and run tests + run: sbt clean test + formatting: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 1 + - name: Set up JDK + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '21' + - uses: actions/cache@v4 + with: + path: | + ~/.sbt + ~/.coursier + key: ${{ runner.os }}-sbt-${{ hashfiles('**/build.sbt') }} + - name: Check formatting + run: sbt scalafmtCheck Test/scalafmtCheck + - run: echo "Previous step failed because code is not formatted. Run 'sbt scalafmt Test/scalafmt'" + if: ${{ failure() }} \ No newline at end of file diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..dd7bd1b --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,56 @@ +name: release +on: + push: + branches: [master, main] + tags: ["*"] + paths-ignore: ['**.md'] + workflow_dispatch: #allows manual trigger + +concurrency: production + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: '0' + - name: Set up JDK + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '21' + - name: Get next release version (dry run) + id: taggerDryRun + uses: anothrNick/github-tag-action@1.61.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + WITH_V: true + DRY_RUN: true + - name: echo new tag + run: | + export NEXT_VERSION=${{ steps.taggerDryRun.outputs.new_tag }} + echo "The next tag version will be: $NEXT_VERSION" + - name: echo tag + run: | + echo "The current tag is: ${{ steps.taggerDryRun.outputs.tag }}" + - name: Compile + run: sbt clean stage + - name: Generate Ruby Types + run: ./joern-benchmarks-datasets + - name: Rename + run: | + mv workspace/ichanae_jssrc.zip ichanae_jssrc.zip + - name: Set next release version + id: taggerFinal + uses: anothrNick/github-tag-action@1.61.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + WITH_V: true + - name: Release + uses: softprops/action-gh-release@v1 + with: + tag_name: ${{ steps.taggerDryRun.outputs.new_tag }} + files: | + ichanae_jssrc.zip \ No newline at end of file From 23488c138c92458a4badf7857f020fac867bc898 Mon Sep 17 00:00:00 2001 From: Andrei Dreyer Date: Mon, 27 May 2024 12:58:37 +0200 Subject: [PATCH 2/5] [workflows] change trigger to PR for release for testing --- .github/workflows/release.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index dd7bd1b..27763d4 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,10 +1,10 @@ name: release -on: - push: - branches: [master, main] - tags: ["*"] - paths-ignore: ['**.md'] - workflow_dispatch: #allows manual trigger +on: pull_request + # push: + # branches: [master, main] + # tags: ["*"] + # paths-ignore: ['**.md'] + # workflow_dispatch: #allows manual trigger concurrency: production From c580bfdace97b5c68880b580cd1aa5911a6e84c7 Mon Sep 17 00:00:00 2001 From: Andrei Dreyer Date: Mon, 27 May 2024 13:02:06 +0200 Subject: [PATCH 3/5] [workflows] spelling mistake --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 27763d4..6de5aba 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -41,7 +41,7 @@ jobs: run: ./joern-benchmarks-datasets - name: Rename run: | - mv workspace/ichanae_jssrc.zip ichanae_jssrc.zip + mv workspace/ichanae.zip ichanae_jssrc.zip - name: Set next release version id: taggerFinal uses: anothrNick/github-tag-action@1.61.0 From b71c1033b6367cafb52a163cd29936ab8027b87b Mon Sep 17 00:00:00 2001 From: Andrei Dreyer Date: Mon, 27 May 2024 13:28:35 +0200 Subject: [PATCH 4/5] [workflows] fix command to run downlaoder --- .github/workflows/release.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 6de5aba..1913970 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -38,10 +38,10 @@ jobs: - name: Compile run: sbt clean stage - name: Generate Ruby Types - run: ./joern-benchmarks-datasets + run: ./joern-benchmarks-datasets ALL - name: Rename run: | - mv workspace/ichanae.zip ichanae_jssrc.zip + mv workspace/ichnaea.zip ichnaea.zip - name: Set next release version id: taggerFinal uses: anothrNick/github-tag-action@1.61.0 @@ -53,4 +53,4 @@ jobs: with: tag_name: ${{ steps.taggerDryRun.outputs.new_tag }} files: | - ichanae_jssrc.zip \ No newline at end of file + ichnaea.zip \ No newline at end of file From d9629bfde1dc91189a710918ed0ca074f563e940 Mon Sep 17 00:00:00 2001 From: Andrei Dreyer Date: Mon, 27 May 2024 13:30:57 +0200 Subject: [PATCH 5/5] [workflows] release rule set back to merging with master --- .github/workflows/release.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 1913970..3630de2 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,10 +1,10 @@ name: release -on: pull_request - # push: - # branches: [master, main] - # tags: ["*"] - # paths-ignore: ['**.md'] - # workflow_dispatch: #allows manual trigger +on: + push: + branches: [master, main] + tags: ["*"] + paths-ignore: ['**.md'] + workflow_dispatch: #allows manual trigger concurrency: production