From 71c3ee3127e566b152bf2ab3d74b40fb652903fa Mon Sep 17 00:00:00 2001 From: /raw PONG _GHMoaCXLT <58883403+q9f@users.noreply.github.com> Date: Fri, 20 Dec 2019 15:55:20 +0100 Subject: [PATCH 1/5] ci: add github actions --- .github/worflows/pull-request.yml | 22 ++++++++++++++++++++++ .travis.yml | 5 ----- 2 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 .github/worflows/pull-request.yml delete mode 100644 .travis.yml diff --git a/.github/worflows/pull-request.yml b/.github/worflows/pull-request.yml new file mode 100644 index 0000000..1a71d5b --- /dev/null +++ b/.github/worflows/pull-request.yml @@ -0,0 +1,22 @@ +name: Pull Requests +on: pull_request + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout Action + uses: actions/checkout@v1 + - name: Install Dependencies + run: | + curl -sSL https://dist.crystal-lang.org/apt/setup.sh | sudo bash + curl -sL "https://keybase.io/crystal/pgp_keys.asc" | sudo apt-key add -Y - + echo "deb https://dist.crystal-lang.org/apt crystal main" | sudo tee /etc/apt/sources.list.d/crystal.list + sudo apt update + sudo apt install -y build-essential crystal libssl-dev libxml2-dev libyaml-dev libgmp-dev libreadline-dev libz-dev + shards install --verbose + - name: Run Test Suite + run: | + shards build --verbose + crystal tool format --check + crystal spec --verbose \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 227f158..0000000 --- a/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: crystal - -script: - - crystal spec - - crystal tool format --check From 148d66c5e5a8fcccc85e3bf74b4cedb8ceb2d2b5 Mon Sep 17 00:00:00 2001 From: /raw PONG _GHMoaCXLT <58883403+q9f@users.noreply.github.com> Date: Fri, 20 Dec 2019 15:59:41 +0100 Subject: [PATCH 2/5] ci: fix path --- .github/worflows/pull-request.yml | 22 ---------------------- .github/workflows/pull-request.yml | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 22 deletions(-) delete mode 100644 .github/worflows/pull-request.yml create mode 100644 .github/workflows/pull-request.yml diff --git a/.github/worflows/pull-request.yml b/.github/worflows/pull-request.yml deleted file mode 100644 index 1a71d5b..0000000 --- a/.github/worflows/pull-request.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Pull Requests -on: pull_request - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout Action - uses: actions/checkout@v1 - - name: Install Dependencies - run: | - curl -sSL https://dist.crystal-lang.org/apt/setup.sh | sudo bash - curl -sL "https://keybase.io/crystal/pgp_keys.asc" | sudo apt-key add -Y - - echo "deb https://dist.crystal-lang.org/apt crystal main" | sudo tee /etc/apt/sources.list.d/crystal.list - sudo apt update - sudo apt install -y build-essential crystal libssl-dev libxml2-dev libyaml-dev libgmp-dev libreadline-dev libz-dev - shards install --verbose - - name: Run Test Suite - run: | - shards build --verbose - crystal tool format --check - crystal spec --verbose \ No newline at end of file diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml new file mode 100644 index 0000000..a1d006a --- /dev/null +++ b/.github/workflows/pull-request.yml @@ -0,0 +1,17 @@ +name: Pull Requests +on: [pull_request, push] + +jobs: + build: + runs-on: ubuntu-latest + container: + image: crystallang/crystal + steps: + - uses: actions/checkout@v1 + - name: Install Dependencies + run: shards install --verbose + - name: Run Test Suite + run: | + shards build --verbose + crystal tool format --check + crystal spec --verbose From e0ec7e95b4b8c70e48b96d0df4b5f6aad38f7313 Mon Sep 17 00:00:00 2001 From: /raw PONG _GHMoaCXLT <58883403+q9f@users.noreply.github.com> Date: Fri, 20 Dec 2019 16:01:19 +0100 Subject: [PATCH 3/5] run crystal tool format --- spec/spec_helper.cr | 6 +++--- src/ec_point.cr | 19 +++++++++---------- src/version.cr | 8 ++++---- 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/spec/spec_helper.cr b/spec/spec_helper.cr index fdafb68..8e354e0 100644 --- a/spec/spec_helper.cr +++ b/spec/spec_helper.cr @@ -1,11 +1,11 @@ # Copyright 2019 @q9f -# +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/src/ec_point.cr b/src/ec_point.cr index 667a9d6..9af820c 100644 --- a/src/ec_point.cr +++ b/src/ec_point.cr @@ -1,11 +1,11 @@ # Copyright 2019 @q9f -# +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -13,13 +13,12 @@ # limitations under the License. module Secp256k1 + # A point on the elliptic curve y^2 = x^3 + 7 + class EC_Point + property x : BigInt + property y : BigInt - # A point on the elliptic curve y^2 = x^3 + 7 - class EC_Point - property x : BigInt - property y : BigInt - - def initialize (@x : BigInt, @y : BigInt) - end + def initialize(@x : BigInt, @y : BigInt) end + end end diff --git a/src/version.cr b/src/version.cr index b8560a1..4112737 100644 --- a/src/version.cr +++ b/src/version.cr @@ -1,11 +1,11 @@ # Copyright 2019 @q9f -# +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -13,5 +13,5 @@ # limitations under the License. module Secp256k1 - VERSION = "0.1.0" + VERSION = "0.1.0" end From 152176381c1403fab2c60ed8c35cd85b273a7e8f Mon Sep 17 00:00:00 2001 From: /raw PONG _GHMoaCXLT <58883403+q9f@users.noreply.github.com> Date: Fri, 20 Dec 2019 16:01:44 +0100 Subject: [PATCH 4/5] ci: only run on pull request --- .github/workflows/pull-request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index a1d006a..e0867cd 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -1,5 +1,5 @@ name: Pull Requests -on: [pull_request, push] +on: [pull_request] jobs: build: From 2a02ba07cacb71434c4ea8ee4a122743d130ff88 Mon Sep 17 00:00:00 2001 From: /raw PONG _GHMoaCXLT <58883403+q9f@users.noreply.github.com> Date: Fri, 20 Dec 2019 16:04:05 +0100 Subject: [PATCH 5/5] ci: add nightly script --- .github/workflows/nightly.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/nightly.yml diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml new file mode 100644 index 0000000..a01becb --- /dev/null +++ b/.github/workflows/nightly.yml @@ -0,0 +1,22 @@ +name: Nightly +on: + push: + branches: + - master + schedule: + - cron: 0 1 * * * + +jobs: + build: + runs-on: ubuntu-latest + container: + image: crystallang/crystal + steps: + - uses: actions/checkout@v1 + - name: Install Dependencies + run: shards install --verbose + - name: Run Test Suite + run: | + shards build --verbose + crystal tool format --check + crystal spec --verbose