From 9f3e6708f77939b0751fe31dc3b813e67b324f59 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 6 Jan 2021 17:22:54 +0100 Subject: [PATCH 01/15] Adding GitHub Actions initial workflow --- .github/workflows/ci.yml | 120 ++++++++++++++++++++++++++++++++++++ .github/workflows/clean.yml | 59 ++++++++++++++++++ build.sbt | 3 + project/plugins.sbt | 1 + 4 files changed, 183 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/clean.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..79147eeb --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,120 @@ +# This file was automatically generated by sbt-github-actions using the +# githubWorkflowGenerate task. You should add and commit this file to +# your git repository. It goes without saying that you shouldn't edit +# this file by hand! Instead, if you wish to make changes, you should +# change your sbt build configuration to revise the workflow description +# to meet your needs, then regenerate this file. + +name: Continuous Integration + +on: + pull_request: + branches: ['*'] + push: + branches: ['*'] + +env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + +jobs: + build: + name: Build and Test + strategy: + matrix: + os: [ubuntu-latest] + scala: [2.12.12, 2.13.3] + java: [adopt@1.8] + runs-on: ${{ matrix.os }} + steps: + - name: Checkout current branch (full) + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Setup Java and Scala + uses: olafurpg/setup-scala@v10 + with: + java-version: ${{ matrix.java }} + + - name: Cache sbt + uses: actions/cache@v2 + with: + path: | + ~/.sbt + ~/.ivy2/cache + ~/.coursier/cache/v1 + ~/.cache/coursier/v1 + ~/AppData/Local/Coursier/Cache/v1 + ~/Library/Caches/Coursier/v1 + key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} + + - name: Check that workflows are up to date + run: sbt ++${{ matrix.scala }} githubWorkflowCheck + + - name: Build project + run: sbt ++${{ matrix.scala }} test + + - name: Compress target directories + run: tar cf targets.tar target play-json/target benchmarks/target examples/target spray-json-macros/target macro-utils/target tagged/target tagged-meta/target spray-json/target slick/target akka-http/target project/target + + - name: Upload target directories + uses: actions/upload-artifact@v2 + with: + name: target-${{ matrix.os }}-${{ matrix.scala }}-${{ matrix.java }} + path: targets.tar + + publish: + name: Publish Artifacts + needs: [build] + if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/master') + strategy: + matrix: + os: [ubuntu-latest] + scala: [2.13.3] + java: [adopt@1.8] + runs-on: ${{ matrix.os }} + steps: + - name: Checkout current branch (full) + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Setup Java and Scala + uses: olafurpg/setup-scala@v10 + with: + java-version: ${{ matrix.java }} + + - name: Cache sbt + uses: actions/cache@v2 + with: + path: | + ~/.sbt + ~/.ivy2/cache + ~/.coursier/cache/v1 + ~/.cache/coursier/v1 + ~/AppData/Local/Coursier/Cache/v1 + ~/Library/Caches/Coursier/v1 + key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} + + - name: Download target directories (2.12.12) + uses: actions/download-artifact@v2 + with: + name: target-${{ matrix.os }}-2.12.12-${{ matrix.java }} + + - name: Inflate target directories (2.12.12) + run: | + tar xf targets.tar + rm targets.tar + + - name: Download target directories (2.13.3) + uses: actions/download-artifact@v2 + with: + name: target-${{ matrix.os }}-2.13.3-${{ matrix.java }} + + - name: Inflate target directories (2.13.3) + run: | + tar xf targets.tar + rm targets.tar + + - name: Publish project + run: sbt ++${{ matrix.scala }} +publish \ No newline at end of file diff --git a/.github/workflows/clean.yml b/.github/workflows/clean.yml new file mode 100644 index 00000000..b535fcc1 --- /dev/null +++ b/.github/workflows/clean.yml @@ -0,0 +1,59 @@ +# This file was automatically generated by sbt-github-actions using the +# githubWorkflowGenerate task. You should add and commit this file to +# your git repository. It goes without saying that you shouldn't edit +# this file by hand! Instead, if you wish to make changes, you should +# change your sbt build configuration to revise the workflow description +# to meet your needs, then regenerate this file. + +name: Clean + +on: push + +jobs: + delete-artifacts: + name: Delete Artifacts + runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - name: Delete artifacts + run: | + # Customize those three lines with your repository and credentials: + REPO=${GITHUB_API_URL}/repos/${{ github.repository }} + + # A shortcut to call GitHub API. + ghapi() { curl --silent --location --user _:$GITHUB_TOKEN "$@"; } + + # A temporary file which receives HTTP response headers. + TMPFILE=/tmp/tmp.$$ + + # An associative array, key: artifact name, value: number of artifacts of that name. + declare -A ARTCOUNT + + # Process all artifacts on this repository, loop on returned "pages". + URL=$REPO/actions/artifacts + while [[ -n "$URL" ]]; do + + # Get current page, get response headers in a temporary file. + JSON=$(ghapi --dump-header $TMPFILE "$URL") + + # Get URL of next page. Will be empty if we are at the last page. + URL=$(grep '^Link:' "$TMPFILE" | tr ',' '\n' | grep 'rel="next"' | head -1 | sed -e 's/.*.*//') + rm -f $TMPFILE + + # Number of artifacts on this page: + COUNT=$(( $(jq <<<$JSON -r '.artifacts | length') )) + + # Loop on all artifacts on this page. + for ((i=0; $i < $COUNT; i++)); do + + # Get name of artifact and count instances of this name. + name=$(jq <<<$JSON -r ".artifacts[$i].name?") + ARTCOUNT[$name]=$(( $(( ${ARTCOUNT[$name]} )) + 1)) + + id=$(jq <<<$JSON -r ".artifacts[$i].id?") + size=$(( $(jq <<<$JSON -r ".artifacts[$i].size_in_bytes?") )) + printf "Deleting '%s' #%d, %'d bytes\n" $name ${ARTCOUNT[$name]} $size + ghapi -X DELETE $REPO/actions/artifacts/$id + done + done \ No newline at end of file diff --git a/build.sbt b/build.sbt index 6be431a5..5bde0a1e 100644 --- a/build.sbt +++ b/build.sbt @@ -3,6 +3,9 @@ val scala_2_13 = "2.13.3" val mainScalaVersion = scala_2_13 val supportedScalaVersions = Seq(scala_2_12, scala_2_13) +ThisBuild / crossScalaVersions := supportedScalaVersions +ThisBuild / scalaVersion := scala_2_13 + lazy val baseSettings = Seq( organization := "pl.iterators", organizationName := "Iterators", diff --git a/project/plugins.sbt b/project/plugins.sbt index bc6733a1..a31151bc 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -4,3 +4,4 @@ addSbtPlugin("com.lucidchart" % "sbt-scalafmt" % "1.15") addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.0") addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.12") addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.2.27") +addSbtPlugin("com.codecommit" % "sbt-github-actions" % "0.9.5") \ No newline at end of file From 613be2c639cecc6dadf028ef23f0a09c1ce67362 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 6 Jan 2021 17:29:19 +0100 Subject: [PATCH 02/15] Delete .travis.yml --- .travis.yml | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 6bfe70d5..00000000 --- a/.travis.yml +++ /dev/null @@ -1,31 +0,0 @@ -sudo: false -language: scala -scala: - - 2.12.12 - - 2.13.3 - -jdk: openjdk8 - -cache: - directories: - - "$HOME/.m2/repository" - - "$HOME/.sbt" - - "$HOME/.ivy2" - -before_cache: -- find $HOME/.sbt -name "*.lock" | xargs rm -- find $HOME/.ivy2 -name "ivydata-*.properties" | xargs rm -- rm -f $HOME/.ivy2/.sbt.ivy.lock - -script: sbt ";++2.12.12 publishLocal; ++$TRAVIS_SCALA_VERSION test" - -notifications: - email: - recipients: - - "mrzeznicki@iterato.rs" - on_success: change - on_failure: always - on_error: always - on_start: never - on_cancel: never - From 18b8aadc87d31447304b66d097b7ded6996d402d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Kiersznowski?= Date: Wed, 13 Jan 2021 16:30:45 +0100 Subject: [PATCH 03/15] fixing cross version conflict --- build.sbt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/build.sbt b/build.sbt index 5bde0a1e..9c926598 100644 --- a/build.sbt +++ b/build.sbt @@ -4,14 +4,14 @@ val mainScalaVersion = scala_2_13 val supportedScalaVersions = Seq(scala_2_12, scala_2_13) ThisBuild / crossScalaVersions := supportedScalaVersions -ThisBuild / scalaVersion := scala_2_13 - +//ThisBuild / scalaVersion := scala_2_13 +//scalaBinaryVersion in ThisBuild := "2.13.3" lazy val baseSettings = Seq( organization := "pl.iterators", organizationName := "Iterators", organizationHomepage := Some(url("https://iterato.rs")), homepage := Some(url("https://github.com/theiterators/kebs")), - scalaVersion := mainScalaVersion, +// scalaVersion := mainScalaVersion, scalacOptions := Seq("-deprecation", "-unchecked", "-feature", "-encoding", "utf8"), scalafmtVersion := "1.3.0", scalafmtOnCompile := true @@ -206,7 +206,8 @@ lazy val sprayJsonMacros = project name := "spray-json-macros", description := "Automatic generation of Spray json formats for case-classes - macros", moduleName := "kebs-spray-json-macros", - crossScalaVersions := supportedScalaVersions + crossScalaVersions := supportedScalaVersions, + crossVersion := CrossVersion.full ) lazy val sprayJsonSupport = project @@ -217,8 +218,7 @@ lazy val sprayJsonSupport = project .settings( name := "spray-json", description := "Automatic generation of Spray json formats for case-classes", - moduleName := "kebs-spray-json", - crossScalaVersions := supportedScalaVersions + moduleName := "kebs-spray-json" ) lazy val playJsonSupport = project From 14148f3f6f49faf25a2d04916483e9f335098a34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Kiersznowski?= Date: Wed, 13 Jan 2021 16:33:50 +0100 Subject: [PATCH 04/15] generating workflow again --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 79147eeb..917c8532 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -70,7 +70,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - scala: [2.13.3] + scala: [2.12.10] java: [adopt@1.8] runs-on: ${{ matrix.os }} steps: From 556b139e8b7ba5fd86b06fa64e97789cc35bdc16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Kiersznowski?= Date: Wed, 13 Jan 2021 17:01:53 +0100 Subject: [PATCH 05/15] disable publication --- build.sbt | 1 + 1 file changed, 1 insertion(+) diff --git a/build.sbt b/build.sbt index 9c926598..ffd10e4e 100644 --- a/build.sbt +++ b/build.sbt @@ -4,6 +4,7 @@ val mainScalaVersion = scala_2_13 val supportedScalaVersions = Seq(scala_2_12, scala_2_13) ThisBuild / crossScalaVersions := supportedScalaVersions +ThisBuild / githubWorkflowPublishTargetBranches := List() //ThisBuild / scalaVersion := scala_2_13 //scalaBinaryVersion in ThisBuild := "2.13.3" lazy val baseSettings = Seq( From 8866c50870aadebca63ce33418aa5e392ede59ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Kiersznowski?= Date: Wed, 13 Jan 2021 17:02:16 +0100 Subject: [PATCH 06/15] disable publication --- .github/workflows/ci.yml | 67 +--------------------------------------- 1 file changed, 1 insertion(+), 66 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 917c8532..f9d7a514 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,69 +52,4 @@ jobs: run: sbt ++${{ matrix.scala }} githubWorkflowCheck - name: Build project - run: sbt ++${{ matrix.scala }} test - - - name: Compress target directories - run: tar cf targets.tar target play-json/target benchmarks/target examples/target spray-json-macros/target macro-utils/target tagged/target tagged-meta/target spray-json/target slick/target akka-http/target project/target - - - name: Upload target directories - uses: actions/upload-artifact@v2 - with: - name: target-${{ matrix.os }}-${{ matrix.scala }}-${{ matrix.java }} - path: targets.tar - - publish: - name: Publish Artifacts - needs: [build] - if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/master') - strategy: - matrix: - os: [ubuntu-latest] - scala: [2.12.10] - java: [adopt@1.8] - runs-on: ${{ matrix.os }} - steps: - - name: Checkout current branch (full) - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Setup Java and Scala - uses: olafurpg/setup-scala@v10 - with: - java-version: ${{ matrix.java }} - - - name: Cache sbt - uses: actions/cache@v2 - with: - path: | - ~/.sbt - ~/.ivy2/cache - ~/.coursier/cache/v1 - ~/.cache/coursier/v1 - ~/AppData/Local/Coursier/Cache/v1 - ~/Library/Caches/Coursier/v1 - key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} - - - name: Download target directories (2.12.12) - uses: actions/download-artifact@v2 - with: - name: target-${{ matrix.os }}-2.12.12-${{ matrix.java }} - - - name: Inflate target directories (2.12.12) - run: | - tar xf targets.tar - rm targets.tar - - - name: Download target directories (2.13.3) - uses: actions/download-artifact@v2 - with: - name: target-${{ matrix.os }}-2.13.3-${{ matrix.java }} - - - name: Inflate target directories (2.13.3) - run: | - tar xf targets.tar - rm targets.tar - - - name: Publish project - run: sbt ++${{ matrix.scala }} +publish \ No newline at end of file + run: sbt ++${{ matrix.scala }} test \ No newline at end of file From 9a495d8b42d01e62375e958f7acd4ba0b345634e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Kiersznowski?= Date: Wed, 13 Jan 2021 17:11:00 +0100 Subject: [PATCH 07/15] setting 2.13 for build scala version, removing CrossVersion.full in spray-json module --- build.sbt | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/build.sbt b/build.sbt index ffd10e4e..364f4e20 100644 --- a/build.sbt +++ b/build.sbt @@ -5,14 +5,13 @@ val supportedScalaVersions = Seq(scala_2_12, scala_2_13) ThisBuild / crossScalaVersions := supportedScalaVersions ThisBuild / githubWorkflowPublishTargetBranches := List() -//ThisBuild / scalaVersion := scala_2_13 -//scalaBinaryVersion in ThisBuild := "2.13.3" +ThisBuild / scalaVersion := mainScalaVersion + lazy val baseSettings = Seq( organization := "pl.iterators", organizationName := "Iterators", organizationHomepage := Some(url("https://iterato.rs")), homepage := Some(url("https://github.com/theiterators/kebs")), -// scalaVersion := mainScalaVersion, scalacOptions := Seq("-deprecation", "-unchecked", "-feature", "-encoding", "utf8"), scalafmtVersion := "1.3.0", scalafmtOnCompile := true @@ -207,8 +206,7 @@ lazy val sprayJsonMacros = project name := "spray-json-macros", description := "Automatic generation of Spray json formats for case-classes - macros", moduleName := "kebs-spray-json-macros", - crossScalaVersions := supportedScalaVersions, - crossVersion := CrossVersion.full + crossScalaVersions := supportedScalaVersions ) lazy val sprayJsonSupport = project From ca6c24cd0d140f345b6d8a2794088d0bdbc92ef6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Kiersznowski?= Date: Wed, 13 Jan 2021 17:17:29 +0100 Subject: [PATCH 08/15] reverting changes in spray-json module --- build.sbt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 364f4e20..ac42c71a 100644 --- a/build.sbt +++ b/build.sbt @@ -217,7 +217,8 @@ lazy val sprayJsonSupport = project .settings( name := "spray-json", description := "Automatic generation of Spray json formats for case-classes", - moduleName := "kebs-spray-json" + moduleName := "kebs-spray-json", + crossScalaVersions := supportedScalaVersions ) lazy val playJsonSupport = project From a9a4ab8b9712d53307483e30e664f7219a676de8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Kiersznowski?= Date: Wed, 20 Jan 2021 12:22:28 +0100 Subject: [PATCH 09/15] testing skipping duplicates --- .github/workflows/ci.yml | 2 ++ build.sbt | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f9d7a514..003ee54a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,6 +48,8 @@ jobs: ~/Library/Caches/Coursier/v1 key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} + - uses: fkirc/skip-duplicate-actions@3.3.0 + - name: Check that workflows are up to date run: sbt ++${{ matrix.scala }} githubWorkflowCheck diff --git a/build.sbt b/build.sbt index ac42c71a..719df7ae 100644 --- a/build.sbt +++ b/build.sbt @@ -5,6 +5,8 @@ val supportedScalaVersions = Seq(scala_2_12, scala_2_13) ThisBuild / crossScalaVersions := supportedScalaVersions ThisBuild / githubWorkflowPublishTargetBranches := List() + +ThisBuild / githubWorkflowJobSetup ++= List(WorkflowStep.Use("fkirc", "skip-duplicate-actions", "3.3.0")) ThisBuild / scalaVersion := mainScalaVersion lazy val baseSettings = Seq( From 24d01b85c31549786a5e606c0f2ce5c6b03ef21c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Kiersznowski?= Date: Wed, 20 Jan 2021 12:28:01 +0100 Subject: [PATCH 10/15] trying to get the plugin working --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 719df7ae..24775dc6 100644 --- a/build.sbt +++ b/build.sbt @@ -6,7 +6,7 @@ val supportedScalaVersions = Seq(scala_2_12, scala_2_13) ThisBuild / crossScalaVersions := supportedScalaVersions ThisBuild / githubWorkflowPublishTargetBranches := List() -ThisBuild / githubWorkflowJobSetup ++= List(WorkflowStep.Use("fkirc", "skip-duplicate-actions", "3.3.0")) +ThisBuild / githubWorkflowJobSetup ++= List(WorkflowStep.Use("fkirc", "skip-duplicate-actions", "3.3.0", name = "Skip duplicate actions")) ThisBuild / scalaVersion := mainScalaVersion lazy val baseSettings = Seq( From 83df33112e0026e54052546eedddfddeb3607fe9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Kiersznowski?= Date: Wed, 20 Jan 2021 12:37:18 +0100 Subject: [PATCH 11/15] fix version number --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 24775dc6..4ba1c230 100644 --- a/build.sbt +++ b/build.sbt @@ -6,7 +6,7 @@ val supportedScalaVersions = Seq(scala_2_12, scala_2_13) ThisBuild / crossScalaVersions := supportedScalaVersions ThisBuild / githubWorkflowPublishTargetBranches := List() -ThisBuild / githubWorkflowJobSetup ++= List(WorkflowStep.Use("fkirc", "skip-duplicate-actions", "3.3.0", name = "Skip duplicate actions")) +ThisBuild / githubWorkflowJobSetup ++= List(WorkflowStep.Use("fkirc", "skip-duplicate-actions", "v3.3.0", name = "Skip duplicate actions")) ThisBuild / scalaVersion := mainScalaVersion lazy val baseSettings = Seq( From 6176afd0cf74c9d71741445d4bd2b4f672313bd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Kiersznowski?= Date: Wed, 20 Jan 2021 12:39:28 +0100 Subject: [PATCH 12/15] generating ci.yml --- .github/workflows/ci.yml | 3 ++- build.sbt | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 003ee54a..f819bfab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,7 +48,8 @@ jobs: ~/Library/Caches/Coursier/v1 key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} - - uses: fkirc/skip-duplicate-actions@3.3.0 + - name: Skip duplicate actions + uses: fkirc/skip-duplicate-actions@v3.3.0 - name: Check that workflows are up to date run: sbt ++${{ matrix.scala }} githubWorkflowCheck diff --git a/build.sbt b/build.sbt index 4ba1c230..d12e5b7a 100644 --- a/build.sbt +++ b/build.sbt @@ -6,7 +6,8 @@ val supportedScalaVersions = Seq(scala_2_12, scala_2_13) ThisBuild / crossScalaVersions := supportedScalaVersions ThisBuild / githubWorkflowPublishTargetBranches := List() -ThisBuild / githubWorkflowJobSetup ++= List(WorkflowStep.Use("fkirc", "skip-duplicate-actions", "v3.3.0", name = "Skip duplicate actions")) +ThisBuild / githubWorkflowJobSetup ++= List( + WorkflowStep.Use("fkirc", "skip-duplicate-actions", "v3.3.0", name = Some("Skip duplicate actions"))) ThisBuild / scalaVersion := mainScalaVersion lazy val baseSettings = Seq( From 6bbf14ee42a37537cf6decc2f8a5863207b91dc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Kiersznowski?= Date: Wed, 20 Jan 2021 12:47:51 +0100 Subject: [PATCH 13/15] trigger CI only on PRs --- .github/workflows/ci.yml | 19 ++----------------- .github/workflows/clean.yml | 9 +-------- build.sbt | 4 ---- project/plugins.sbt | 1 - 4 files changed, 3 insertions(+), 30 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f819bfab..ab339a42 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,18 +1,9 @@ -# This file was automatically generated by sbt-github-actions using the -# githubWorkflowGenerate task. You should add and commit this file to -# your git repository. It goes without saying that you shouldn't edit -# this file by hand! Instead, if you wish to make changes, you should -# change your sbt build configuration to revise the workflow description -# to meet your needs, then regenerate this file. - name: Continuous Integration on: - pull_request: - branches: ['*'] push: + pull_request: branches: ['*'] - env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -48,11 +39,5 @@ jobs: ~/Library/Caches/Coursier/v1 key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} - - name: Skip duplicate actions - uses: fkirc/skip-duplicate-actions@v3.3.0 - - - name: Check that workflows are up to date - run: sbt ++${{ matrix.scala }} githubWorkflowCheck - - name: Build project - run: sbt ++${{ matrix.scala }} test \ No newline at end of file + run: sbt ++${{ matrix.scala }} test diff --git a/.github/workflows/clean.yml b/.github/workflows/clean.yml index b535fcc1..00208a14 100644 --- a/.github/workflows/clean.yml +++ b/.github/workflows/clean.yml @@ -1,10 +1,3 @@ -# This file was automatically generated by sbt-github-actions using the -# githubWorkflowGenerate task. You should add and commit this file to -# your git repository. It goes without saying that you shouldn't edit -# this file by hand! Instead, if you wish to make changes, you should -# change your sbt build configuration to revise the workflow description -# to meet your needs, then regenerate this file. - name: Clean on: push @@ -56,4 +49,4 @@ jobs: printf "Deleting '%s' #%d, %'d bytes\n" $name ${ARTCOUNT[$name]} $size ghapi -X DELETE $REPO/actions/artifacts/$id done - done \ No newline at end of file + done diff --git a/build.sbt b/build.sbt index d12e5b7a..23ed69b9 100644 --- a/build.sbt +++ b/build.sbt @@ -4,10 +4,6 @@ val mainScalaVersion = scala_2_13 val supportedScalaVersions = Seq(scala_2_12, scala_2_13) ThisBuild / crossScalaVersions := supportedScalaVersions -ThisBuild / githubWorkflowPublishTargetBranches := List() - -ThisBuild / githubWorkflowJobSetup ++= List( - WorkflowStep.Use("fkirc", "skip-duplicate-actions", "v3.3.0", name = Some("Skip duplicate actions"))) ThisBuild / scalaVersion := mainScalaVersion lazy val baseSettings = Seq( diff --git a/project/plugins.sbt b/project/plugins.sbt index a31151bc..bc6733a1 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -4,4 +4,3 @@ addSbtPlugin("com.lucidchart" % "sbt-scalafmt" % "1.15") addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.0") addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.12") addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.2.27") -addSbtPlugin("com.codecommit" % "sbt-github-actions" % "0.9.5") \ No newline at end of file From e23c9df1817e3eadd8ec3368e5c833fd64ae446e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Kiersznowski?= Date: Wed, 20 Jan 2021 12:51:24 +0100 Subject: [PATCH 14/15] trigger CI only on PRs --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ab339a42..7040e4fd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,6 +16,7 @@ jobs: scala: [2.12.12, 2.13.3] java: [adopt@1.8] runs-on: ${{ matrix.os }} + if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != 'theiterators/kebs' steps: - name: Checkout current branch (full) uses: actions/checkout@v2 From 521f1b9b8ddefeb831ff20cab8cd7b631caf345f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Kiersznowski?= Date: Wed, 20 Jan 2021 13:01:30 +0100 Subject: [PATCH 15/15] trigger push build only on master branch --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7040e4fd..d5542c93 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,6 +2,7 @@ name: Continuous Integration on: push: + branches: ['master'] pull_request: branches: ['*'] env: @@ -16,7 +17,6 @@ jobs: scala: [2.12.12, 2.13.3] java: [adopt@1.8] runs-on: ${{ matrix.os }} - if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != 'theiterators/kebs' steps: - name: Checkout current branch (full) uses: actions/checkout@v2