Skip to content

Commit a6093d0

Browse files
authored
merge: Merge pull request #9 from jerusdp/nightly
- Build and Publish Nightly Rust image
2 parents 2cf247b + 02beee0 commit a6093d0

File tree

3 files changed

+44
-5
lines changed

3 files changed

+44
-5
lines changed

.github/workflows/nightly.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Build Nightly Rust
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '0 2 * * 3'
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- run: |
14+
make build
15+
make test
16+
env:
17+
RUST_VERSION: nightly
18+
TAG: nightly
19+
IMAGE: 'rustserverless/lambda-rust:nightly'
20+
publish:
21+
needs: [test]
22+
if: github.repository == 'rust-serverless/lambda-rust'
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v2
26+
- run: make publish
27+
env:
28+
RUST_VERSION: nightly
29+
TAG: nightly
30+
create_issue:
31+
runs-on: ubuntu-latest
32+
needs: [publish]
33+
if: always() && (needs.publish.result == 'failure')
34+
steps:
35+
- run: gh issue create --title "Nightly publication failed" --body "Nightly publication failed" --label "bug" -R $GITHUB_REPOSITORY
36+
env:
37+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
38+

Makefile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,17 @@ DOCKER ?= docker
22
INPUT_RELEASE_VERSION ?= 0.4.0
33
RUST_VERSION ?= 1.55.0
44
REPO ?= rustserverless/lambda-rust
5+
TAG ?= latest
56

67
publish: build
7-
$(DOCKER) push $(REPO):latest
8+
$(DOCKER) push $(REPO):${TAG}
89

910
publish-tag: build publish
10-
$(DOCKER) tag $(REPO):latest "$(REPO):$(INPUT_RELEASE_VERSION)-rust-$(RUST_VERSION)"
11+
$(DOCKER) tag $(REPO):${TAG} "$(REPO):$(INPUT_RELEASE_VERSION)-rust-$(RUST_VERSION)"
1112
$(DOCKER) push "$(REPO):$(INPUT_RELEASE_VERSION)-rust-$(RUST_VERSION)"
1213

1314
build:
14-
$(DOCKER) build --build-arg RUST_VERSION=$(RUST_VERSION) -t $(REPO):latest .
15+
$(DOCKER) build --build-arg RUST_VERSION=$(RUST_VERSION) -t $(REPO):${TAG} .
1516

1617
test:
1718
@tests/test.sh
@@ -23,4 +24,4 @@ debug: build
2324
-v ${HOME}/.cargo/registry:/cargo/registry \
2425
-v ${HOME}/.cargo/git:/cargo/git \
2526
--entrypoint=/bin/bash \
26-
$(REPO)
27+
$(REPO):$(TAG)

tests/test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
HERE="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
55
# Root directory of the repository
66
DIST=$(cd "$HERE"/..; pwd)
7-
IMAGE=${1:-rustserverless/lambda-rust}
7+
: "${IMAGE:=rustserverless/lambda-rust}"
88

99
source "${HERE}"/bashtest.sh
1010

0 commit comments

Comments
 (0)