From b31e262b84c895551d103b907a10d625dd6d5514 Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Mon, 13 Sep 2021 07:14:54 +0100 Subject: [PATCH 01/43] Add .vscode to ignored files --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 0c5b82d..08851c5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ tests/test-*/test-out.log target .DS_Store +.vscode \ No newline at end of file From 7f0e12e34685a06a2ec71d75a760e81c48769d99 Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Mon, 13 Sep 2021 07:22:59 +0100 Subject: [PATCH 02/43] Script to check cersion Problem Rust releases a new version approximatly every six weeks. We need to detect a new release Solution * install the current stable toolchain * extract the version of the stable toolchain from rustup check * extract the version of the installed toolchain from rustup default * compare and return an error if they do not match Note Docker containers are built with a specific version (not stable). --- latest.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 latest.sh diff --git a/latest.sh b/latest.sh new file mode 100755 index 0000000..cf60355 --- /dev/null +++ b/latest.sh @@ -0,0 +1,15 @@ +#!/bin/bash -eux + +export CARGO_HOME="/cargo" +export RUSTUP_HOME="/rustup" + +# shellcheck disable=SC1091 +source /cargo/env + +rustup toolchain install stable --profile=minimal +STABLE=$(rustup check | grep stable | grep -E "[0-9]+\.[0-9]+\.[0-9]+" -o) +DEFAULT=$(rustup show | grep -m 1 default | grep -E "[0-9]+\.[0-9]+\.[0-9]+" -o) + +if [ "${STABLE}" == "${DEFAULT}" ]; then exit 0 + else exit 1 +fi \ No newline at end of file From 18f24aced8c70c0b64a4440e3e17e305a28b813c Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Mon, 13 Sep 2021 07:25:01 +0100 Subject: [PATCH 03/43] Check the latest R build Problem Script to check must be installed in the build Solution * Add the latest.sh script to container Note --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 1ba03c6..e4df896 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,6 +6,7 @@ RUN yum install -y jq openssl-devel RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \ | CARGO_HOME=/cargo RUSTUP_HOME=/rustup sh -s -- -y --profile minimal --default-toolchain $RUST_VERSION ADD build.sh /usr/local/bin/ +ADD latest.sh /usr/local/bin/ VOLUME ["/code"] WORKDIR /code ENTRYPOINT ["/usr/local/bin/build.sh"] From 2c5cec83e152dcc47c2e2a51c2fc34a1e9ff1a9e Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Mon, 13 Sep 2021 07:29:53 +0100 Subject: [PATCH 04/43] Check the Rust version Problem Exceute the latest.sh script Solution * make command to run the latest.sh script entrypoint Note --- Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Makefile b/Makefile index 6388a68..b762d3e 100644 --- a/Makefile +++ b/Makefile @@ -24,3 +24,8 @@ debug: build -v ${HOME}/.cargo/git:/cargo/git \ --entrypoint=/bin/bash \ $(REPO) + +check: + $(DOCKER) run --rm \ + --entrypoint=/usr/local/bin/latest.sh \ + $(REPO) From b45f57154e30800f8c2903143a9505b414819be8 Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Mon, 13 Sep 2021 07:35:39 +0100 Subject: [PATCH 05/43] Schedule Github Actions Version Check Problem Version check should be executed routinely Solution * Use scheduled github action to run check * Load unix and checkout source * Make check to run script Note * docker on host will download latest conainer --- .github/workflows/check.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/workflows/check.yml diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000..d5a0b16 --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,13 @@ +name: Main + +on: + schedule: + - cron "0 4 * * 3" + +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Check Rust Version + run: make check From 1cb9025b38d820ec8a2c27c1397bb94d2ebea9be Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Mon, 13 Sep 2021 08:59:43 +0100 Subject: [PATCH 06/43] FIX: On speficication --- .github/workflows/check.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index d5a0b16..7eccda3 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -1,8 +1,8 @@ -name: Main +name: Check on: schedule: - - cron "0 4 * * 3" + - cron "0 4 * * 3" jobs: check: From 54b76fb6d95e1f655e004b441be416708d846872 Mon Sep 17 00:00:00 2001 From: Jeremiah Russell <47631109+jerusdp@users.noreply.github.com> Date: Mon, 13 Sep 2021 09:10:44 +0100 Subject: [PATCH 07/43] Update check.yml FIX: missing colon on cron --- .github/workflows/check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 7eccda3..cebb61b 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -2,7 +2,7 @@ name: Check on: schedule: - - cron "0 4 * * 3" + - cron: '0 4 * * 3' jobs: check: From b511fbd6b8c195ff177c554997ed4b7ca426d6b3 Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Mon, 13 Sep 2021 09:40:41 +0100 Subject: [PATCH 08/43] Test using my docker --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index b762d3e..b73c750 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ DOCKER ?= docker INPUT_RELEASE_VERSION ?= 0.4.0 -RUST_VERSION ?= 1.55.0 -REPO ?= rustserverless/lambda-rust +RUST_VERSION ?= 1.54.0 +REPO ?= jerusdp/lambda-rust publish: build $(DOCKER) push $(REPO):latest From a8a2778282c34097332f45630df2693327682d8a Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Mon, 13 Sep 2021 09:44:49 +0100 Subject: [PATCH 09/43] Scheduled test for top of next hour --- .github/workflows/check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index cebb61b..93f56f3 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -2,7 +2,7 @@ name: Check on: schedule: - - cron: '0 4 * * 3' + - cron: '0 10 * * 2' jobs: check: From 5788290e68969121e63fd058946e4cc140f6540f Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Mon, 13 Sep 2021 10:37:32 +0100 Subject: [PATCH 10/43] manual trigger option --- .github/workflows/check.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 93f56f3..9434541 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -1,6 +1,7 @@ name: Check on: + workflow_dispatch schedule: - cron: '0 10 * * 2' From 7980f14fde5d9f1e463fd67921d054aedb746228 Mon Sep 17 00:00:00 2001 From: Jeremiah Russell <47631109+jerusdp@users.noreply.github.com> Date: Mon, 13 Sep 2021 10:48:39 +0100 Subject: [PATCH 11/43] Update check.yml FIX: yaml error --- .github/workflows/check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 9434541..eafdb3f 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -1,7 +1,7 @@ name: Check on: - workflow_dispatch + workflow_dispatch: schedule: - cron: '0 10 * * 2' From 031cf8d3cb1815b3565640c98becd06b72bd64d1 Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Mon, 13 Sep 2021 12:09:23 +0100 Subject: [PATCH 12/43] Create an issue --- .github/workflows/check.yml | 12 ++++++++++++ latest.sh | 7 +++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 9434541..c0997f0 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -12,3 +12,15 @@ jobs: - uses: actions/checkout@v1 - name: Check Rust Version run: make check + create_issue: + runs-on: ubuntu-latest + needs: check + if: needs.check.result == 'failure' + steps: + - uses: nashmaniac/create-issue-action@v1.1 + name: Create Issue Action + with: + title: Build Failed + token: ${{secrets.GITHUB_TOKEN}} + labels: rust-check-failed + body: Update to rust stable version ${{ check.output.stable }} diff --git a/latest.sh b/latest.sh index cf60355..5bf9601 100755 --- a/latest.sh +++ b/latest.sh @@ -9,7 +9,10 @@ source /cargo/env rustup toolchain install stable --profile=minimal STABLE=$(rustup check | grep stable | grep -E "[0-9]+\.[0-9]+\.[0-9]+" -o) DEFAULT=$(rustup show | grep -m 1 default | grep -E "[0-9]+\.[0-9]+\.[0-9]+" -o) +echo "::set-output name=stable_rust::$STABLE" -if [ "${STABLE}" == "${DEFAULT}" ]; then exit 0 - else exit 1 +if [ "${STABLE}" == "${DEFAULT}" ]; then + exit 0 +else + exit 1 fi \ No newline at end of file From 07d006bafdc2806ab7e7197b7f56332b9c290204 Mon Sep 17 00:00:00 2001 From: Jeremiah Russell <47631109+jerusdp@users.noreply.github.com> Date: Mon, 13 Sep 2021 12:21:32 +0100 Subject: [PATCH 13/43] Update check.yml --- .github/workflows/check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index bd5ffc0..edaba32 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -23,4 +23,4 @@ jobs: title: Build Failed token: ${{secrets.GITHUB_TOKEN}} labels: rust-check-failed - body: Update to rust stable version ${{ check.output.stable }} + body: Update to rust stable version ${{ need.check.output.stable }} From b2b6e2402b0cadff3821593ff0aed48d51cd9c28 Mon Sep 17 00:00:00 2001 From: Jeremiah Russell <47631109+jerusdp@users.noreply.github.com> Date: Mon, 13 Sep 2021 12:25:45 +0100 Subject: [PATCH 14/43] Update check.yml --- .github/workflows/check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index edaba32..82a5f4c 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -23,4 +23,4 @@ jobs: title: Build Failed token: ${{secrets.GITHUB_TOKEN}} labels: rust-check-failed - body: Update to rust stable version ${{ need.check.output.stable }} + body: Update to rust stable version need.check.output.stable From c29d947f367342a93903b24e7b61c9d426bef268 Mon Sep 17 00:00:00 2001 From: Jeremiah Russell <47631109+jerusdp@users.noreply.github.com> Date: Mon, 13 Sep 2021 12:39:32 +0100 Subject: [PATCH 15/43] Update check.yml --- .github/workflows/check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 82a5f4c..c9c1a56 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -15,7 +15,7 @@ jobs: create_issue: runs-on: ubuntu-latest needs: check - if: needs.check.result == 'failure' + if: always() && (needs.check.result == 'failure') steps: - uses: nashmaniac/create-issue-action@v1.1 name: Create Issue Action From 25f1118ff29e4ee94bc686154b74cdaf566d2103 Mon Sep 17 00:00:00 2001 From: Jeremiah Russell <47631109+jerusdp@users.noreply.github.com> Date: Mon, 13 Sep 2021 13:55:51 +0100 Subject: [PATCH 16/43] Update check.yml --- .github/workflows/check.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index c9c1a56..71d8c14 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -8,8 +8,11 @@ on: jobs: check: runs-on: ubuntu-latest + outputs: + stable_rust: ${{ steps.check-rust.outputs.stable }} steps: - uses: actions/checkout@v1 + - id: check-rust - name: Check Rust Version run: make check create_issue: @@ -23,4 +26,4 @@ jobs: title: Build Failed token: ${{secrets.GITHUB_TOKEN}} labels: rust-check-failed - body: Update to rust stable version need.check.output.stable + body: Update to rust stable version {{needs.check.output.stable_rust}} From 25009e17cb0ffbbf9762293bdf3ea5b1fdb124e0 Mon Sep 17 00:00:00 2001 From: Jeremiah Russell <47631109+jerusdp@users.noreply.github.com> Date: Mon, 13 Sep 2021 15:02:37 +0100 Subject: [PATCH 17/43] Update check.yml added checkout --- .github/workflows/check.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 71d8c14..da9ba3e 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -9,10 +9,10 @@ jobs: check: runs-on: ubuntu-latest outputs: - stable_rust: ${{ steps.check-rust.outputs.stable }} + stable: ${{ steps.rust.outputs.stable }} steps: - uses: actions/checkout@v1 - - id: check-rust + - id: rust - name: Check Rust Version run: make check create_issue: @@ -20,10 +20,11 @@ jobs: needs: check if: always() && (needs.check.result == 'failure') steps: + - uses: actions/checkout@master - uses: nashmaniac/create-issue-action@v1.1 name: Create Issue Action with: title: Build Failed token: ${{secrets.GITHUB_TOKEN}} labels: rust-check-failed - body: Update to rust stable version {{needs.check.output.stable_rust}} + body: Update to rust stable version {{needs.check.output.stable}} From 28970f97ab6ec38e12c0353d5317022541ab72dc Mon Sep 17 00:00:00 2001 From: Jeremiah Russell <47631109+jerusdp@users.noreply.github.com> Date: Mon, 13 Sep 2021 15:05:13 +0100 Subject: [PATCH 18/43] Update check.yml checkout version2 --- .github/workflows/check.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index da9ba3e..b89cf0e 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -11,7 +11,7 @@ jobs: outputs: stable: ${{ steps.rust.outputs.stable }} steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - id: rust - name: Check Rust Version run: make check @@ -20,7 +20,7 @@ jobs: needs: check if: always() && (needs.check.result == 'failure') steps: - - uses: actions/checkout@master + - uses: actions/checkout@v2 - uses: nashmaniac/create-issue-action@v1.1 name: Create Issue Action with: From f94da9e8fc93a23f35234b9c8e95689a9bc0e374 Mon Sep 17 00:00:00 2001 From: Jeremiah Russell <47631109+jerusdp@users.noreply.github.com> Date: Mon, 13 Sep 2021 15:09:05 +0100 Subject: [PATCH 19/43] Update check.yml FIX: ID created new step --- .github/workflows/check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index b89cf0e..2d0fd80 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -13,7 +13,7 @@ jobs: steps: - uses: actions/checkout@v2 - id: rust - - name: Check Rust Version + name: Check Rust Version run: make check create_issue: runs-on: ubuntu-latest From 82e5485476d4346a9af64620b04eb562bc2c22ba Mon Sep 17 00:00:00 2001 From: Jeremiah Russell <47631109+jerusdp@users.noreply.github.com> Date: Mon, 13 Sep 2021 15:18:58 +0100 Subject: [PATCH 20/43] Update check.yml Use different create issue action --- .github/workflows/check.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 2d0fd80..697e5bd 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -21,10 +21,12 @@ jobs: if: always() && (needs.check.result == 'failure') steps: - uses: actions/checkout@v2 - - uses: nashmaniac/create-issue-action@v1.1 - name: Create Issue Action - with: - title: Build Failed - token: ${{secrets.GITHUB_TOKEN}} - labels: rust-check-failed - body: Update to rust stable version {{needs.check.output.stable}} + - name: Create Issue + uses: bryannice/gitactions-git-issue-creation@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_COMMIT_SHA: ${{ github.sha }} + GITHUB_REPO_OWNER: 'bryan-nice' + GITHUB_REPO_NAME: 'github-issue-creation' + GITHUB_ISSUE_TITLE: 'Demo''ing Git Issue Creation' + GITHUB_ISSUE_BODY: 'Demo''ing Git Issue Creation' From 4cbb4ceb604db4bff9a7ec947fedee5ffb470476 Mon Sep 17 00:00:00 2001 From: Jeremiah Russell <47631109+jerusdp@users.noreply.github.com> Date: Mon, 13 Sep 2021 15:27:44 +0100 Subject: [PATCH 21/43] Update check.yml --- .github/workflows/check.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 697e5bd..473a258 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -26,7 +26,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_COMMIT_SHA: ${{ github.sha }} - GITHUB_REPO_OWNER: 'bryan-nice' - GITHUB_REPO_NAME: 'github-issue-creation' + GITHUB_REPO_OWNER: 'jerusdp' + GITHUB_REPO_NAME: 'lambda-rust' GITHUB_ISSUE_TITLE: 'Demo''ing Git Issue Creation' GITHUB_ISSUE_BODY: 'Demo''ing Git Issue Creation' From 2ef0d9315d7c3ff959a4ce31e8b787478bf64c6c Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Mon, 13 Sep 2021 16:33:49 +0100 Subject: [PATCH 22/43] FIX: Update to write issue on failure --- .github/workflows/check.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index bd5ffc0..0e96ccc 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -12,10 +12,17 @@ jobs: - uses: actions/checkout@v1 - name: Check Rust Version run: make check + outputs: + stable: ${{ steps.rust.outputs.stable }} + steps: + - uses: actions/checkout@v2 + - id: rust + name: Check Rust Version + run: make check create_issue: runs-on: ubuntu-latest needs: check - if: needs.check.result == 'failure' + if: always() && (needs.check.result == 'failure') steps: - uses: nashmaniac/create-issue-action@v1.1 name: Create Issue Action @@ -23,4 +30,4 @@ jobs: title: Build Failed token: ${{secrets.GITHUB_TOKEN}} labels: rust-check-failed - body: Update to rust stable version ${{ check.output.stable }} + body: Update to rust stable version ${{ needs.check.output.stable }} From c45e592e48953609f6ac5066947b86a2f52ab48e Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Mon, 13 Sep 2021 16:40:01 +0100 Subject: [PATCH 23/43] FIX - too much copying :( --- .github/workflows/check.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 4d54674..64da43c 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -15,13 +15,6 @@ jobs: - id: rust name: Check Rust Version run: make check - outputs: - stable: ${{ steps.rust.outputs.stable }} - steps: - - uses: actions/checkout@v2 - - id: rust - name: Check Rust Version - run: make check create_issue: runs-on: ubuntu-latest needs: check From 78e507d8b27d57940df73bfa997c1ed3f6db86a1 Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Mon, 13 Sep 2021 17:05:05 +0100 Subject: [PATCH 24/43] echo stable --- latest.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/latest.sh b/latest.sh index 5bf9601..6ba9e08 100755 --- a/latest.sh +++ b/latest.sh @@ -9,8 +9,8 @@ source /cargo/env rustup toolchain install stable --profile=minimal STABLE=$(rustup check | grep stable | grep -E "[0-9]+\.[0-9]+\.[0-9]+" -o) DEFAULT=$(rustup show | grep -m 1 default | grep -E "[0-9]+\.[0-9]+\.[0-9]+" -o) -echo "::set-output name=stable_rust::$STABLE" - +echo "::set-output name=stable_rust::${STABLE}" +echo "${STABLE}" if [ "${STABLE}" == "${DEFAULT}" ]; then exit 0 else From 41a8ce5965e67cad8d1eee039b3b3b7572351cc3 Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Mon, 13 Sep 2021 17:09:12 +0100 Subject: [PATCH 25/43] attempt to use gh to create the issue within the shell script ] --- .github/workflows/check.yml | 2 +- latest.sh | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 64da43c..bb02011 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -23,7 +23,7 @@ jobs: - uses: nashmaniac/create-issue-action@v1.1 name: Create Issue Action with: - title: Build Failed + title: Time to update to Rust v${{ needs.check.output.stable }} token: ${{secrets.GITHUB_TOKEN}} labels: rust-check-failed body: Update to rust stable version ${{ needs.check.output.stable }} diff --git a/latest.sh b/latest.sh index 6ba9e08..58b1c04 100755 --- a/latest.sh +++ b/latest.sh @@ -14,5 +14,6 @@ echo "${STABLE}" if [ "${STABLE}" == "${DEFAULT}" ]; then exit 0 else + gh issue create --title "Time to update to Rust ${STABLE}" --body "Build update for Rust ${STABLE}" exit 1 fi \ No newline at end of file From 2abdf53d9cad9f82935816fda9eaf2dae70d3272 Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Mon, 13 Sep 2021 19:12:08 +0100 Subject: [PATCH 26/43] Wrong variable being transferred --- .github/workflows/check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index bb02011..910802a 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -9,7 +9,7 @@ jobs: check: runs-on: ubuntu-latest outputs: - stable: ${{ steps.rust.outputs.stable }} + stable: ${{ steps.rust.outputs.stable_rust }} steps: - uses: actions/checkout@v2 - id: rust From 10a671d1cbae4ca236edbebc1f1c946f3df3749f Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Mon, 13 Sep 2021 19:28:17 +0100 Subject: [PATCH 27/43] Use gh instead of action --- .github/workflows/check.yml | 11 +---------- latest.sh | 10 +++------- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 910802a..fc83210 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -8,11 +8,8 @@ on: jobs: check: runs-on: ubuntu-latest - outputs: - stable: ${{ steps.rust.outputs.stable_rust }} steps: - uses: actions/checkout@v2 - - id: rust name: Check Rust Version run: make check create_issue: @@ -20,10 +17,4 @@ jobs: needs: check if: always() && (needs.check.result == 'failure') steps: - - uses: nashmaniac/create-issue-action@v1.1 - name: Create Issue Action - with: - title: Time to update to Rust v${{ needs.check.output.stable }} - token: ${{secrets.GITHUB_TOKEN}} - labels: rust-check-failed - body: Update to rust stable version ${{ needs.check.output.stable }} + - run: gh issue create --title "Time to update to Rust" --body "Build update for next version of Rust" diff --git a/latest.sh b/latest.sh index 58b1c04..cf60355 100755 --- a/latest.sh +++ b/latest.sh @@ -9,11 +9,7 @@ source /cargo/env rustup toolchain install stable --profile=minimal STABLE=$(rustup check | grep stable | grep -E "[0-9]+\.[0-9]+\.[0-9]+" -o) DEFAULT=$(rustup show | grep -m 1 default | grep -E "[0-9]+\.[0-9]+\.[0-9]+" -o) -echo "::set-output name=stable_rust::${STABLE}" -echo "${STABLE}" -if [ "${STABLE}" == "${DEFAULT}" ]; then - exit 0 -else - gh issue create --title "Time to update to Rust ${STABLE}" --body "Build update for Rust ${STABLE}" - exit 1 + +if [ "${STABLE}" == "${DEFAULT}" ]; then exit 0 + else exit 1 fi \ No newline at end of file From ba1cdf07836dc790ffe45bc59b1622151da4df8d Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Mon, 13 Sep 2021 19:34:36 +0100 Subject: [PATCH 28/43] Use gh instead of action --- .github/workflows/check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index fc83210..a746619 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -17,4 +17,4 @@ jobs: needs: check if: always() && (needs.check.result == 'failure') steps: - - run: gh issue create --title "Time to update to Rust" --body "Build update for next version of Rust" + - run: gh issue create --title "Time to update to Rust" --body "Build update for next version of Rust" \ No newline at end of file From 6f55fa851b0dec6de6142506615d90bc6bfb7c34 Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Mon, 13 Sep 2021 19:41:52 +0100 Subject: [PATCH 29/43] FIX missing step indicator --- .github/workflows/check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index a746619..f807600 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -11,7 +11,7 @@ jobs: steps: - uses: actions/checkout@v2 name: Check Rust Version - run: make check + - run: make check create_issue: runs-on: ubuntu-latest needs: check From a9f159f54b2641fbc38b9fd5023e2cbb7f1f7170 Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Mon, 13 Sep 2021 19:45:24 +0100 Subject: [PATCH 30/43] FIXadd checkout to get auth? --- .github/workflows/check.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index f807600..d061e9f 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -17,4 +17,5 @@ jobs: needs: check if: always() && (needs.check.result == 'failure') steps: + - uses: actions/checkout@v2 - run: gh issue create --title "Time to update to Rust" --body "Build update for next version of Rust" \ No newline at end of file From 98f58eeffad360e4d7468094bd26027390a99853 Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Mon, 13 Sep 2021 19:55:01 +0100 Subject: [PATCH 31/43] FIX: Add environment with GITHUB_TOKEN --- .github/workflows/check.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index d061e9f..a193a64 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -17,5 +17,6 @@ jobs: needs: check if: always() && (needs.check.result == 'failure') steps: - - uses: actions/checkout@v2 - - run: gh issue create --title "Time to update to Rust" --body "Build update for next version of Rust" \ No newline at end of file + - run: gh issue create --title "Time to update to Rust" --body "Build update for next version of Rust" + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} \ No newline at end of file From c9d8ee0e8cba1e8969ceb57ae8440cbc3cc82976 Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Mon, 13 Sep 2021 20:06:47 +0100 Subject: [PATCH 32/43] FIX: Use gh to clone instead of checkout --- .github/workflows/check.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index a193a64..1646b3a 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -17,6 +17,9 @@ jobs: needs: check if: always() && (needs.check.result == 'failure') steps: + - run: gh repo clone lambda-rust + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - run: gh issue create --title "Time to update to Rust" --body "Build update for next version of Rust" env: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} \ No newline at end of file From a78ce53c5017cf3d767807e911c16c7d00d9a756 Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Mon, 13 Sep 2021 20:11:13 +0100 Subject: [PATCH 33/43] FIX Use checkout --- .github/workflows/check.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 1646b3a..12077b2 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -17,9 +17,7 @@ jobs: needs: check if: always() && (needs.check.result == 'failure') steps: - - run: gh repo clone lambda-rust - env: - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + - uses: actions/checkout@v2 - run: gh issue create --title "Time to update to Rust" --body "Build update for next version of Rust" env: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} \ No newline at end of file From 340b481da6cfa55ebe29cf627e7bae43fd3dfa62 Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Mon, 13 Sep 2021 20:14:30 +0100 Subject: [PATCH 34/43] Add label to issue --- .github/workflows/check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 12077b2..ee9291e 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -18,6 +18,6 @@ jobs: if: always() && (needs.check.result == 'failure') steps: - uses: actions/checkout@v2 - - run: gh issue create --title "Time to update to Rust" --body "Build update for next version of Rust" + - run: gh issue create --title "Time to update to Rust" --body "Build update for next version of Rust" --label update-rust-version env: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} \ No newline at end of file From dc545df873ff99dda9bcfc21ddb9dfa53ee1f8b2 Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Tue, 14 Sep 2021 08:49:46 +0100 Subject: [PATCH 35/43] Change label to existing lable --- .github/workflows/check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index ee9291e..3a7b45d 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -18,6 +18,6 @@ jobs: if: always() && (needs.check.result == 'failure') steps: - uses: actions/checkout@v2 - - run: gh issue create --title "Time to update to Rust" --body "Build update for next version of Rust" --label update-rust-version + - run: gh issue create --title "Time to update to Rust" --body "Build update for next version of Rust" --label enhancement env: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} \ No newline at end of file From 2c86d65e248bc707f03982911d120a680083199a Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Tue, 14 Sep 2021 09:51:33 +0100 Subject: [PATCH 36/43] Create issue on the repository without checking out by using -R flag --- .github/workflows/check.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index cebb61b..5676bfe 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -1,6 +1,7 @@ name: Check on: + workflow-dispatch: schedule: - cron: '0 4 * * 3' @@ -8,6 +9,14 @@ jobs: check: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 - - name: Check Rust Version - run: make check + - uses: actions/checkout@v2 + name: Check Rust Version + - run: make check + create_issue: + runs-on: ubuntu-latest + needs: check + if: always() && (needs.check.result == 'failure') + steps: + - run: gh issue create --title "Time to update to Rust" --body "Build update for next version of Rust" --label "enhancement" - R $GITHUB_REPOSITORY + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} \ No newline at end of file From 9c19ad7fdcc68af15797f0a82a88238fb9cebcac Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Tue, 14 Sep 2021 09:54:53 +0100 Subject: [PATCH 37/43] FIX spelling of workflow_dispatch --- .github/workflows/check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 5676bfe..0f9386c 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -1,7 +1,7 @@ name: Check on: - workflow-dispatch: + workflow_dispatch: schedule: - cron: '0 4 * * 3' From e615839dccfbbf6d683caa2eeec9b299942cb48a Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Tue, 14 Sep 2021 10:40:46 +0100 Subject: [PATCH 38/43] FIX wayward space in -R --- .github/workflows/check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 0f9386c..1aaae66 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -17,6 +17,6 @@ jobs: needs: check if: always() && (needs.check.result == 'failure') steps: - - run: gh issue create --title "Time to update to Rust" --body "Build update for next version of Rust" --label "enhancement" - R $GITHUB_REPOSITORY + - run: gh issue create --title "Time to update to Rust" --body "Build update for next version of Rust" --label "enhancement" -R $GITHUB_REPOSITORY env: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} \ No newline at end of file From 59d3085b9b2c02647abfae3d6dd33a26c5ad81fa Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Tue, 14 Sep 2021 10:43:26 +0100 Subject: [PATCH 39/43] Update cron schedule to run early Tuesday morning --- .github/workflows/check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 44619ef..1aaae66 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -3,7 +3,7 @@ name: Check on: workflow_dispatch: schedule: - - cron: '0 10 * * 2' + - cron: '0 4 * * 3' jobs: check: From c54e3a39ac6f5e4b3badda3f42d87653534907f0 Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Tue, 14 Sep 2021 11:03:37 +0100 Subject: [PATCH 40/43] Restore Makefile after testing --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index b73c750..96d4e55 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ DOCKER ?= docker INPUT_RELEASE_VERSION ?= 0.4.0 -RUST_VERSION ?= 1.54.0 -REPO ?= jerusdp/lambda-rust +RUST_VERSION ?= 1.55.0 +REPO ?= rustserverless/lambda-rust publish: build $(DOCKER) push $(REPO):latest @@ -28,4 +28,4 @@ debug: build check: $(DOCKER) run --rm \ --entrypoint=/usr/local/bin/latest.sh \ - $(REPO) + $(REPO) \ No newline at end of file From 438171c2bb7eadc4fd57b700a4eaf5768b9a1f17 Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Thu, 30 Sep 2021 12:24:34 +0100 Subject: [PATCH 41/43] Added missing newlines --- .github/workflows/check.yml | 3 ++- .gitignore | 2 +- latest.sh | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 1aaae66..2b0faf5 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -19,4 +19,5 @@ jobs: steps: - run: gh issue create --title "Time to update to Rust" --body "Build update for next version of Rust" --label "enhancement" -R $GITHUB_REPOSITORY env: - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} \ No newline at end of file + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + \ No newline at end of file diff --git a/.gitignore b/.gitignore index 08851c5..cb01b5b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ tests/test-*/test-out.log target .DS_Store -.vscode \ No newline at end of file +.vscode diff --git a/latest.sh b/latest.sh index cf60355..f39f922 100755 --- a/latest.sh +++ b/latest.sh @@ -12,4 +12,4 @@ DEFAULT=$(rustup show | grep -m 1 default | grep -E "[0-9]+\.[0-9]+\.[0-9]+" -o) if [ "${STABLE}" == "${DEFAULT}" ]; then exit 0 else exit 1 -fi \ No newline at end of file +fi From 680fa57a7bce49930ce66017415ed32eba4f012e Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Thu, 30 Sep 2021 12:25:19 +0100 Subject: [PATCH 42/43] Added missing newlines --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 96d4e55..c774be3 100644 --- a/Makefile +++ b/Makefile @@ -28,4 +28,5 @@ debug: build check: $(DOCKER) run --rm \ --entrypoint=/usr/local/bin/latest.sh \ - $(REPO) \ No newline at end of file + $(REPO) + \ No newline at end of file From 5bc6605c8e390b86d929399f5e10f673e8365aef Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Thu, 30 Sep 2021 12:30:49 +0100 Subject: [PATCH 43/43] Resolve conflict with Makefile updated by nightly --- Makefile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index c774be3..77005cf 100644 --- a/Makefile +++ b/Makefile @@ -2,16 +2,17 @@ DOCKER ?= docker INPUT_RELEASE_VERSION ?= 0.4.0 RUST_VERSION ?= 1.55.0 REPO ?= rustserverless/lambda-rust +TAG ?= latest publish: build - $(DOCKER) push $(REPO):latest + $(DOCKER) push $(REPO):${TAG} publish-tag: build publish - $(DOCKER) tag $(REPO):latest "$(REPO):$(INPUT_RELEASE_VERSION)-rust-$(RUST_VERSION)" + $(DOCKER) tag $(REPO):${TAG} "$(REPO):$(INPUT_RELEASE_VERSION)-rust-$(RUST_VERSION)" $(DOCKER) push "$(REPO):$(INPUT_RELEASE_VERSION)-rust-$(RUST_VERSION)" build: - $(DOCKER) build --build-arg RUST_VERSION=$(RUST_VERSION) -t $(REPO):latest . + $(DOCKER) build --build-arg RUST_VERSION=$(RUST_VERSION) -t $(REPO):${TAG} . test: @tests/test.sh @@ -23,7 +24,7 @@ debug: build -v ${HOME}/.cargo/registry:/cargo/registry \ -v ${HOME}/.cargo/git:/cargo/git \ --entrypoint=/bin/bash \ - $(REPO) + $(REPO):$(TAG) check: $(DOCKER) run --rm \