From 363b0ef69c3a0ec73413277721d173bfe3bf36fe Mon Sep 17 00:00:00 2001 From: Alexander Zaitsev Date: Wed, 18 Aug 2021 06:52:00 +0300 Subject: [PATCH 01/68] feat: initial changes after the fork - update README with proper links - refactor a little bit ignore files - update changelog (add missing newer Rust versions) - update Makefile defaults - add me to the license file Tested: - Local tests --- .dockerignore | 2 +- .github/workflows/main.yml | 2 +- CHANGELOG.md | 4 ++++ Dockerfile | 4 ++-- LICENSE | 2 +- Makefile | 19 ++++++++++--------- README.md | 14 +++++++------- 7 files changed, 26 insertions(+), 21 deletions(-) diff --git a/.dockerignore b/.dockerignore index 1d3ec08..10ac9a8 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,2 +1,2 @@ tests -.git \ No newline at end of file +.git diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 958edc1..3873015 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -42,4 +42,4 @@ jobs: shell: bash run: | echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin - make publish \ No newline at end of file + make publish diff --git a/CHANGELOG.md b/CHANGELOG.md index 50e1327..88f9e78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.4.0-rust-1.54.0 + +* Upgrade to Rust [`1.54.0`](https://blog.rust-lang.org/2021/07/29/Rust-1.54.0.html) + # 0.4.0-rust-1.45.2 * **Breaking change** in avoid mixed user permissions when volume mounting cargo cache directories. This docker images now configures a cargo installation to `/cargo` directory rather than `/home/root/.cargo`. You'll also want to ensure diff --git a/Dockerfile b/Dockerfile index e5ba94a..1ba03c6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ # https://github.com/lambci/docker-lambda#documentation -FROM lambci/lambda:build-provided.al2 +FROM docker.io/lambci/lambda:build-provided.al2 -ARG RUST_VERSION=1.51.0 +ARG RUST_VERSION=1.54.0 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 diff --git a/LICENSE b/LICENSE index a28713d..4c8837e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2020 Doug Tangren +Copyright (c) 2020 Doug Tangren, 2021 Alexander Zaitsev Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/Makefile b/Makefile index 483adf9..721da5e 100644 --- a/Makefile +++ b/Makefile @@ -1,23 +1,24 @@ +DOCKER ?= docker VERSION ?= 0.4.0 -RUST_VERSION ?= 1.51.0 -REPO ?= softprops/lambda-rust +RUST_VERSION ?= 1.54.0 +REPO ?= rustserverless/lambda-rust TAG ?= "$(REPO):$(VERSION)-rust-$(RUST_VERSION)" publish: build - @docker push $(TAG) - @docker push $(REPO):latest + $(DOCKER) push $(TAG) + $(DOCKER) push $(REPO):latest build: - @docker build --build-arg RUST_VERSION=$(RUST_VERSION) -t $(TAG) . - @docker tag $(TAG) $(REPO):latest + $(DOCKER) build --build-arg RUST_VERSION=$(RUST_VERSION) -t $(TAG) . + $(DOCKER) tag $(TAG) $(REPO):latest -test: build +test: @tests/test.sh debug: build - @docker run --rm -it \ + $(DOCKER) run --rm -it \ -u $(id -u):$(id -g) \ - -v ${PWD}:/code \ + -v ${PWD}:/code:Z \ -v ${HOME}/.cargo/registry:/cargo/registry \ -v ${HOME}/.cargo/git:/cargo/git \ --entrypoint=/bin/bash \ diff --git a/README.md b/README.md index bbf8016..76a5323 100644 --- a/README.md +++ b/README.md @@ -15,9 +15,9 @@ where `{rust-stable-version}` is a stable version of rust. You can find a list of available docker tags [here](https://hub.docker.com/r/softprops/lambda-rust/tags) -> 💡 If you don't find the version you're looking for, please [open a new github issue](https://github.com/softprops/lambda-rust/issues/new?title=I%27m%20looking%20for%20version%20xxx) to publish one +> 💡 If you don't find the version you're looking for, please [open a new github issue](https://github.com/rust-serverless/lambda-rust/issues/new?title=I%27m%20looking%20for%20version%20xxx) to publish one -You can also depend directly on `softprops/lambda-rust:latest` for the most recently published version. +You can also depend directly on `rustserverless/lambda-rust:latest` for the most recently published version. ## 🤸 usage @@ -45,7 +45,7 @@ $ docker run --rm \ -v ${PWD}:/code \ -v ${HOME}/.cargo/registry:/cargo/registry \ -v ${HOME}/.cargo/git:/cargo/git \ - softprops/lambda-rust + rustserverless/lambda-rust ``` > 💡 The -v (volume mount) flags for `/cargo/{registry,git}` are optional but when supplied, provides a much faster turn around when doing iterative development @@ -68,7 +68,7 @@ $ docker run --rm \ -v ${PWD}:/code \ -v ${HOME}/.cargo/registry:/cargo/registry \ -v ${HOME}/.cargo/git:/cargo/git \ - softprops/lambda-rust + rustserverless/lambda-rust ``` For more custom codebases, the '-w' argument can be used to override the working directory. @@ -82,7 +82,7 @@ $ docker run --rm \ -v ${HOME}/.cargo/registry:/cargo/registry \ -v ${HOME}/.cargo/git:/cargo/git \ -w /code/lambdas/mylambda \ - softprops/lambda-rust + rustserverless/lambda-rust ``` ## ⚓ using hooks @@ -120,7 +120,7 @@ docker run \ -v ${PWD}:/code \ -v ${HOME}/.cargo/registry:/cargo/registry \ -v ${HOME}/.cargo/git:/cargo/git \ - softprops/lambda-rust + rustserverless/lambda-rust # start a one-off docker container replicating the "provided.al2" lambda runtime # awaiting an event to be provided via stdin @@ -197,4 +197,4 @@ $ cargo aws-lambda --help More instructions can be found [here](https://github.com/vvilhonen/cargo-aws-lambda). -Doug Tangren (softprops) 2020 +Doug Tangren (softprops) 2020, Alexander Zaitsev (zamazan4ik) 2021 From 3a81d04e7ad4ef67a4108aa4c4293e44bef31ccc Mon Sep 17 00:00:00 2001 From: Alexander Zaitsev Date: Wed, 18 Aug 2021 18:44:03 +0300 Subject: [PATCH 02/68] doc: update README - fix wrong links to old softprops repos --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 76a5323..9d8a02c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# AWS Lambda [Rust](https://www.rust-lang.org/) docker builder 🐑 🦀 🐳 [![Build Status](https://github.com/softprops/lambda-rust/workflows/Main/badge.svg)](https://github.com/softprops/lambda-rust/actions) +# AWS Lambda [Rust](https://www.rust-lang.org/) docker builder 🐑 🦀 🐳 [![Build Status](https://github.com/rust-serverless/lambda-rust/workflows/Main/badge.svg)](https://github.com/rust-serverless/lambda-rust/actions) ## 🤔 about @@ -10,10 +10,10 @@ This provides a build environment, consistent with your target execution environ ## 📦 install -Tags for this docker image follow the naming convention `softprops/lambda-rust:{version}-rust-{rust-stable-version}` +Tags for this docker image follow the naming convention `rustserverless/lambda-rust:{version}-rust-{rust-stable-version}` where `{rust-stable-version}` is a stable version of rust. -You can find a list of available docker tags [here](https://hub.docker.com/r/softprops/lambda-rust/tags) +You can find a list of available docker tags [here](https://hub.docker.com/r/rustserverless/lambda-rust/tags) > 💡 If you don't find the version you're looking for, please [open a new github issue](https://github.com/rust-serverless/lambda-rust/issues/new?title=I%27m%20looking%20for%20version%20xxx) to publish one @@ -197,4 +197,5 @@ $ cargo aws-lambda --help More instructions can be found [here](https://github.com/vvilhonen/cargo-aws-lambda). -Doug Tangren (softprops) 2020, Alexander Zaitsev (zamazan4ik) 2021 +Doug Tangren ([softprops](https://github.com/softprops)) 2020, Alexander Zaitsev ([zamazan4ik](https://github.com/zamazan4ik)) 2021 + From 979a9837a6c20cbeb8ccf4416f521d74e190c049 Mon Sep 17 00:00:00 2001 From: Michael Torres Date: Sun, 22 Aug 2021 11:36:44 -0700 Subject: [PATCH 03/68] Fix test image reference --- tests/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test.sh b/tests/test.sh index 51c9f6f..b200bff 100755 --- a/tests/test.sh +++ b/tests/test.sh @@ -4,7 +4,7 @@ HERE="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" # Root directory of the repository DIST=$(cd "$HERE"/..; pwd) -IMAGE=${1:-softprops/lambda-rust} +IMAGE=${1:-rustserverless/lambda-rust} source "${HERE}"/bashtest.sh From e7e54b80e17786bf1d265ce58f2bba3d154ceca3 Mon Sep 17 00:00:00 2001 From: Michael Torres Date: Sun, 22 Aug 2021 12:13:57 -0700 Subject: [PATCH 04/68] Rework GH actions to CD latest, tag on release --- .github/workflows/main.yml | 20 +------------------- .github/workflows/release.yml | 33 +++++++++++++++++++++++++++++++++ .github/workflows/untrusted.yml | 14 ++++++++++++++ Makefile | 10 +++++----- 4 files changed, 53 insertions(+), 24 deletions(-) create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/untrusted.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3873015..4597602 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,11 +4,6 @@ on: push: branches: - master - tags: - - 'v**' - pull_request: - branches: - - master jobs: test: @@ -17,18 +12,6 @@ jobs: - uses: actions/checkout@v1 - name: Test run: make test - publish-docs: - needs: [test] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - name: Update Docker hub metadata - uses: docker://mpepping/docker-hub-metadata-github-action - env: - IMAGE: ${{ github.repository }} - DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - continue-on-error: true publish: needs: [test] runs-on: ubuntu-latest @@ -37,8 +20,7 @@ jobs: - name: Build shell: bash run: make build - - name: Publish - if: startsWith(github.ref, 'refs/tags/') + - name: Publish Latest shell: bash run: | echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..ef4fa4b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,33 @@ +name: Release publishing + +on: + release: + types: + - published + +jobs: + publish-docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Update Docker hub metadata + uses: docker://mpepping/docker-hub-metadata-github-action + env: + IMAGE: rustserverless/lambda-rust + DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} + DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} + continue-on-error: true + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Build + shell: bash + run: make build + - name: Publish + shell: bash + with: + release_tag: ${{ github.event.release.tag_name }} + run: | + echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin + make publish-tag diff --git a/.github/workflows/untrusted.yml b/.github/workflows/untrusted.yml new file mode 100644 index 0000000..b611376 --- /dev/null +++ b/.github/workflows/untrusted.yml @@ -0,0 +1,14 @@ +name: Untrusted workflows (PRs) + +on: + pull_request: + branches: + - master + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Test + run: make test \ No newline at end of file diff --git a/Makefile b/Makefile index 721da5e..5181911 100644 --- a/Makefile +++ b/Makefile @@ -1,16 +1,16 @@ DOCKER ?= docker -VERSION ?= 0.4.0 RUST_VERSION ?= 1.54.0 REPO ?= rustserverless/lambda-rust -TAG ?= "$(REPO):$(VERSION)-rust-$(RUST_VERSION)" publish: build - $(DOCKER) push $(TAG) $(DOCKER) push $(REPO):latest +publish-tag: build publish + $(DOCKER) tag $(REPO):latest "$(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 $(TAG) . - $(DOCKER) tag $(TAG) $(REPO):latest + $(DOCKER) build --build-arg RUST_VERSION=$(RUST_VERSION) -t $(REPO):latest . test: @tests/test.sh From 4aef9db4358771de1e25feaac732de5c62042ad4 Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Thu, 9 Sep 2021 17:25:26 +0100 Subject: [PATCH 05/68] Makefile updated to use Rust 1.55.0 as the default version --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 5181911..1a6585c 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ DOCKER ?= docker -RUST_VERSION ?= 1.54.0 +RUST_VERSION ?= 1.55.0 REPO ?= rustserverless/lambda-rust publish: build From 049a8b755edb45d4dc47ceb0e127942dd33d9bdf Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Fri, 10 Sep 2021 09:49:14 +0100 Subject: [PATCH 06/68] Update change log for Rust version 1.55.0 --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 88f9e78..5c7e724 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.4.0-rust-1.55.0 + +* Upgrade to Rust [`1.55.0`](https://blog.rust-lang.org/2021/09/09/Rust-1.55.0.html) + # 0.4.0-rust-1.54.0 * Upgrade to Rust [`1.54.0`](https://blog.rust-lang.org/2021/07/29/Rust-1.54.0.html) From 2cf247b04008dbdfe4496c7d7f61ab370ea2078a Mon Sep 17 00:00:00 2001 From: Alexander Zaitsev Date: Fri, 10 Sep 2021 15:17:14 +0300 Subject: [PATCH 07/68] fix: fix publishing releases - add new parameter to Makefile - delete wrong 'with' clause from Github Actions file Tested: - No --- .github/workflows/release.yml | 2 -- Makefile | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ef4fa4b..fbe6d4c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,8 +26,6 @@ jobs: run: make build - name: Publish shell: bash - with: - release_tag: ${{ github.event.release.tag_name }} run: | echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin make publish-tag diff --git a/Makefile b/Makefile index 1a6585c..6388a68 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ DOCKER ?= docker +INPUT_RELEASE_VERSION ?= 0.4.0 RUST_VERSION ?= 1.55.0 REPO ?= rustserverless/lambda-rust From b31e262b84c895551d103b907a10d625dd6d5514 Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Mon, 13 Sep 2021 07:14:54 +0100 Subject: [PATCH 08/68] 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 09/68] 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 10/68] 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 11/68] 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 12/68] 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 13/68] 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 14/68] 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 15/68] 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 16/68] 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 17/68] 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 18/68] 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 19/68] 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 20/68] 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 21/68] 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 22/68] 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 23/68] 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 24/68] 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 25/68] 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 26/68] 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 27/68] 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 28/68] 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 29/68] 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 30/68] 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 31/68] 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 32/68] 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 33/68] 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 34/68] 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 35/68] 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 36/68] 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 37/68] 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 38/68] 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 39/68] 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 40/68] 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 41/68] 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 42/68] 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 43/68] 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 44/68] 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 45/68] 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 46/68] 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 47/68] 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 4640e2dd7421a386fb89e43f4368761edbc23311 Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Fri, 17 Sep 2021 13:02:48 +0100 Subject: [PATCH 48/68] Conditional execution of publish on the correct public repository --- .github/workflows/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4597602..abf97f2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,7 +13,8 @@ jobs: - name: Test run: make test publish: - needs: [test] + needs: [scan, test] + if: github.repository == 'rustserverless/lambda-rust' runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 From a37f5653c8fbd1348f2d132471908e500fe367e3 Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Fri, 17 Sep 2021 12:40:52 +0100 Subject: [PATCH 49/68] Use github.repository to set REPO --- .github/workflows/main.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index abf97f2..5c1d868 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -6,6 +6,26 @@ on: - master jobs: + scan: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Build + env: + REPO: ${{ github.repository }} + shell: bash + run: | + echo "docker_repo=${{ env.REPO }}" >> $GITHUB_ENV + make build + - name: Trivy vulnerability scanner + uses: aquasecurity/trivy-action@0.0.20 + with: + image-ref: '${{ env.docker_repo }}:latest' + format: 'table' + exit-code: '1' + ignore-unfixed: true + vuln-type: 'os,library' + severity: 'CRITICAL,HIGH' test: runs-on: ubuntu-latest steps: From 67cc806ad4b193c8e1bf2119fb74369e55930d3d Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Fri, 17 Sep 2021 11:40:11 +0100 Subject: [PATCH 50/68] Update main to include security scan and address issue #6 --- .github/workflows/main.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5c1d868..3893e13 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -30,6 +30,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 + - name: Build + shell: bash + run: make build - name: Test run: make test publish: From 81ac9b03b4d85ecaac0deceb9c875578f407c618 Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Fri, 17 Sep 2021 11:10:36 +0100 Subject: [PATCH 51/68] Remove original version of kernel-devel as its not updated by yum and instead a second version is installed --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index 1ba03c6..b84c683 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,6 +2,8 @@ FROM docker.io/lambci/lambda:build-provided.al2 ARG RUST_VERSION=1.54.0 +RUN yum -y update +RUN yum -y remove kernel-devel-4.14.203-156.332.amzn2 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 From 2b9e5e8feb4fa86ebb9e1637c10afda4a787247a Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Fri, 17 Sep 2021 07:15:32 +0100 Subject: [PATCH 52/68] Update environent variable setting --- .github/workflows/security.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/security.yml diff --git a/.github/workflows/security.yml b/.github/workflows/security.yml new file mode 100644 index 0000000..f55f327 --- /dev/null +++ b/.github/workflows/security.yml @@ -0,0 +1,32 @@ +name: Security + +on: + push: + branches: + - master + +jobs: + test: + name: Security Test + runs-on: ubuntu-latest + steps: + - name: Checkout the repo + uses: actions/checkout@v1 + + - name: Build my Image + env: + REPO: 'jerusdp/lambda-rust' + run: | + echo "docker_repo=${{ env.REPO }}" >> $GITHUB_ENV + make build + + - name: Run Trivy vulnerability scanner + uses: aquasecurity/trivy-action@0.0.20 + with: + image-ref: '${{ env.docker_repo }}:latest' + format: 'table' + exit-code: '1' + ignore-unfixed: true + vuln-type: 'os,library' + severity: 'CRITICAL,HIGH' + From 8494333cc38dc3fa3380945c04810bc6a33c096f Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Fri, 17 Sep 2021 15:46:02 +0100 Subject: [PATCH 53/68] Add .vscode to gitignore and delete seurity.yml working file --- .github/workflows/security.yml | 32 -------------------------------- .gitignore | 1 + 2 files changed, 1 insertion(+), 32 deletions(-) delete mode 100644 .github/workflows/security.yml diff --git a/.github/workflows/security.yml b/.github/workflows/security.yml deleted file mode 100644 index f55f327..0000000 --- a/.github/workflows/security.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Security - -on: - push: - branches: - - master - -jobs: - test: - name: Security Test - runs-on: ubuntu-latest - steps: - - name: Checkout the repo - uses: actions/checkout@v1 - - - name: Build my Image - env: - REPO: 'jerusdp/lambda-rust' - run: | - echo "docker_repo=${{ env.REPO }}" >> $GITHUB_ENV - make build - - - name: Run Trivy vulnerability scanner - uses: aquasecurity/trivy-action@0.0.20 - with: - image-ref: '${{ env.docker_repo }}:latest' - format: 'table' - exit-code: '1' - ignore-unfixed: true - vuln-type: 'os,library' - severity: 'CRITICAL,HIGH' - 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 571527080fc6961cac3c794725aa64c2bd9f0b2e Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Fri, 17 Sep 2021 15:57:24 +0100 Subject: [PATCH 54/68] FIX: Correct the name of the master repository to rust-serverless/lambda-rust --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3893e13..a8f7d7f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -37,7 +37,7 @@ jobs: run: make test publish: needs: [scan, test] - if: github.repository == 'rustserverless/lambda-rust' + if: github.repository == 'rust-serverless/lambda-rust' runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 From 9c22b3d4134e76bb7bbcceb08ec23a26a4f1a3eb Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Sun, 19 Sep 2021 09:12:08 +0100 Subject: [PATCH 55/68] Added workflow to build nightly Rust each night at 0200 --- .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..10ff4cc --- /dev/null +++ b/.github/workflows/nightly.yml @@ -0,0 +1,22 @@ +name: Build Nightly Rust + +on: + workflow_dispatch: + schedule: + - cron: '0 2 * * 3' + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + name: Build Nightly Rust + - run: make nightly + create_issue: + runs-on: ubuntu-latest + needs: check + if: always() && (needs.publish.result == 'failure') + steps: + - run: gh issue create --title "Nightly publication failed" --body "Nightly publication failed" --label "bug" -R $GITHUB_REPOSITORY + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} \ No newline at end of file From fe4b20170b7cfca2d03e877be6cd7425f330b50a Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Sun, 19 Sep 2021 09:22:02 +0100 Subject: [PATCH 56/68] Nigthly make script to build and push nightly Rust --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index 6388a68..8f2d2fd 100644 --- a/Makefile +++ b/Makefile @@ -24,3 +24,7 @@ debug: build -v ${HOME}/.cargo/git:/cargo/git \ --entrypoint=/bin/bash \ $(REPO) + +nightly: + $(DOCKER) build --build-arg RUST_VERSION=nightly -t $(REPO):nightly . + $(DOCKER) push $(REPO):nightly \ No newline at end of file From dc9cce05de84c6e26b60d4a7763ff919b207d43b Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Mon, 20 Sep 2021 07:24:45 +0100 Subject: [PATCH 57/68] Set IMAGE based on enirvonment or default --- tests/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test.sh b/tests/test.sh index b200bff..0a2f1ba 100755 --- a/tests/test.sh +++ b/tests/test.sh @@ -4,7 +4,7 @@ HERE="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" # Root directory of the repository DIST=$(cd "$HERE"/..; pwd) -IMAGE=${1:-rustserverless/lambda-rust} +: "${IMAGE:=rustserverless/lambda-rust}" source "${HERE}"/bashtest.sh From b934a750da8ea2117254e0dc84a194348a6daf3a Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Mon, 20 Sep 2021 08:07:17 +0100 Subject: [PATCH 58/68] Add Tag to Makefile Problem Makefile only makes latest and tags with Rust version Solution - variable TAG to set the tag with default latest - tag the debug build to allows debugging non-latest builds Note --- Makefile | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 8f2d2fd..3b101c4 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,8 +24,4 @@ debug: build -v ${HOME}/.cargo/registry:/cargo/registry \ -v ${HOME}/.cargo/git:/cargo/git \ --entrypoint=/bin/bash \ - $(REPO) - -nightly: - $(DOCKER) build --build-arg RUST_VERSION=nightly -t $(REPO):nightly . - $(DOCKER) push $(REPO):nightly \ No newline at end of file + $(REPO):$(TAG) From 507fdc77397448e0a36b1b6be0995e9d4fee2164 Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Mon, 20 Sep 2021 08:35:15 +0100 Subject: [PATCH 59/68] Build and Publish Nightly Rust Problem Nighlty Rust is updated every night! Solution - Action runs each night at 0200 UTC - Action can be dispatched from console - Run test job and make with environment set to use and tag nigthly - Run publsh job on successful test with nightly - Only run publish on rust-serverless repo - Publish issue if publication fails Note Not configured to run security scan (part of seperate PR). --- .github/workflows/nightly.yml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 10ff4cc..3e8f5ac 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -6,15 +6,27 @@ on: - cron: '0 2 * * 3' jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: make test + env: + RUST_VERSION: nightly + TAG: nightly publish: + needs: [test] + if: github.repository == "rust-serverless/lambda-rust" runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Build Nightly Rust - - run: make nightly + - run: make publish + env: + RUST_VERSION: nightly + TAG: nightly create_issue: runs-on: ubuntu-latest - needs: check + needs: [publish] if: always() && (needs.publish.result == 'failure') steps: - run: gh issue create --title "Nightly publication failed" --body "Nightly publication failed" --label "bug" -R $GITHUB_REPOSITORY From 800f52fcd4b6b38af76a2286029a1568b92c6516 Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Mon, 20 Sep 2021 08:58:53 +0100 Subject: [PATCH 60/68] FIX: double quotes to single quotes --- .github/workflows/nightly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 3e8f5ac..eb7cc76 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -16,7 +16,7 @@ jobs: TAG: nightly publish: needs: [test] - if: github.repository == "rust-serverless/lambda-rust" + if: github.repository == 'rust-serverless/lambda-rust' runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 From b9ac56a0d93af9358ce1a5fd3048b06e3f80fd64 Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Mon, 20 Sep 2021 09:31:03 +0100 Subject: [PATCH 61/68] FIX: test needs to use the nigthly container image --- .github/workflows/nightly.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index eb7cc76..57f661f 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -14,6 +14,7 @@ jobs: env: RUST_VERSION: nightly TAG: nightly + IMAGE: 'rustserverless/lambda-rust:nightly' publish: needs: [test] if: github.repository == 'rust-serverless/lambda-rust' From 15367fa2d3746a597f6898ecab25aa4d2ea4599e Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Mon, 20 Sep 2021 09:35:52 +0100 Subject: [PATCH 62/68] FIX: need to build before test --- .github/workflows/nightly.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 57f661f..a579b63 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -10,7 +10,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - run: make test + - run: | + make build + make test env: RUST_VERSION: nightly TAG: nightly From 02beee0109aaff61c36bfab3161effbdaaf28d76 Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Thu, 30 Sep 2021 11:37:05 +0100 Subject: [PATCH 63/68] Added newline to nightly.yml --- .github/workflows/nightly.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index a579b63..079166e 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -34,4 +34,5 @@ jobs: steps: - run: gh issue create --title "Nightly publication failed" --body "Nightly publication failed" --label "bug" -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 From 438171c2bb7eadc4fd57b700a4eaf5768b9a1f17 Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Thu, 30 Sep 2021 12:24:34 +0100 Subject: [PATCH 64/68] 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 65/68] 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 66/68] 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 \ From 8c4e25cbd5c210cc4254720020699fcbb582d475 Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Thu, 30 Sep 2021 12:58:07 +0100 Subject: [PATCH 67/68] Added missing newlines --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 2924262965d15e9d03061680e61529142b064a9a Mon Sep 17 00:00:00 2001 From: Michael Torres Date: Tue, 5 Oct 2021 18:16:49 -0700 Subject: [PATCH 68/68] Add autobuild to stable --- .github/workflows/stable.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/stable.yml diff --git a/.github/workflows/stable.yml b/.github/workflows/stable.yml new file mode 100644 index 0000000..ff8cb94 --- /dev/null +++ b/.github/workflows/stable.yml @@ -0,0 +1,35 @@ +name: Build Stable Rust + +on: + workflow_dispatch: + schedule: + - cron: '0 2 * * 3' + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: | + make build + make test + env: + RUST_VERSION: stable + publish: + needs: [test] + if: github.repository == 'rust-serverless/lambda-rust' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: make publish-tag + env: + RUST_VERSION: stable + create_issue: + runs-on: ubuntu-latest + needs: [publish] + if: always() && (needs.publish.result == 'failure') + steps: + - run: gh issue create --title "Stable publication failed" --body "Stable publication failed" --label "bug" -R $GITHUB_REPOSITORY + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + \ No newline at end of file