Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build Nightly 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: nightly
TAG: nightly
IMAGE: 'rustserverless/lambda-rust:nightly'
publish:
needs: [test]
if: github.repository == 'rust-serverless/lambda-rust'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: make publish
env:
RUST_VERSION: nightly
TAG: nightly
create_issue:
runs-on: ubuntu-latest
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
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -23,4 +24,4 @@ debug: build
-v ${HOME}/.cargo/registry:/cargo/registry \
-v ${HOME}/.cargo/git:/cargo/git \
--entrypoint=/bin/bash \
$(REPO)
$(REPO):$(TAG)
2 changes: 1 addition & 1 deletion tests/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down