-
Notifications
You must be signed in to change notification settings - Fork 5
136 lines (113 loc) · 4.16 KB
/
on-pull-request.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
name: on-pull-request
on:
pull_request:
branches: [main]
env:
CARGO_TERM_COLOR: always
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TEST_CACHE_NAME: rust-integration-test-ci-cache-${{ github.sha }}
TEST_STORE_NAME: rust-integration-test-ci-store-${{ github.sha }}
jobs:
rustfmt:
name: main - Style & Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Log rust versions
run: |
set -e
set -x
rustc --version
cargo --version
rustup show
- name: Verify README generation
uses: momentohq/standards-and-practices/github-actions/oss-readme-template@gh-actions-v2
with:
project_status: official
project_stability: beta
project_type: sdk
sdk_language: Rust
dev_docs_slug: rust
- name: Verify Example README generation
uses: momentohq/standards-and-practices/github-actions/oss-readme-template@gh-actions-v2
with:
project_status: official
project_stability: beta
project_type: other
template_file: ./example/README.template.md
output_file: ./example/README.md
- name: Verify Rust Example README generation
uses: momentohq/standards-and-practices/github-actions/oss-readme-template@gh-actions-v2
with:
project_status: official
project_stability: beta
project_type: other
template_file: ./example/rust/README.template.md
output_file: ./example/rust/README.md
- name: Verify CDK Lambda Example README generation
uses: momentohq/standards-and-practices/github-actions/oss-readme-template@gh-actions-v2
with:
project_status: official
project_stability: beta
project_type: other
template_file: ./example/aws/cdk-lambda/README.template.md
output_file: ./example/aws/cdk-lambda/README.md
- name: Verify Zip Lambda Example README generation
uses: momentohq/standards-and-practices/github-actions/oss-readme-template@gh-actions-v2
with:
project_status: official
project_stability: beta
project_type: other
template_file: ./example/aws/zip-lambda/README.template.md
output_file: ./example/aws/zip-lambda/README.md
- name: Commitlint and Other Shared Build Steps
uses: momentohq/standards-and-practices/github-actions/shared-build@gh-actions-v1
- uses: Swatinem/rust-cache@v2
- name: Lint (rustfmt and clippy)
run: make lint
- name: Compile docs
run: make docs
build_rust:
runs-on: ubuntu-24.04
env:
MOMENTO_API_KEY: ${{ secrets.ALPHA_TEST_AUTH_TOKEN }}
steps:
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
- name: Build
run: make build
- name: Test Setup
run: make ci-test-setup
- name: Unit tests
run: make test-unit
- name: Integration Tests
run: make test-integration
- name: Doc Tests
run: make test-doctests
- name: Test Teardown
# We want the teardown to execute even if an earlier step fails, hence the `always()` condition
if: always()
run: make ci-test-teardown
- name: Run examples
run: make run-examples
rustfmt-build-examples:
name: examples - Style & Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Commitlint and Other Shared Build Steps
uses: momentohq/standards-and-practices/github-actions/shared-build@gh-actions-v1
- uses: Swatinem/rust-cache@v2
- name: rustfmt -> rigorous lint via Clippy -> build
id: validation
continue-on-error: true
run: make build-examples
- name: Send CI failure mail
if: ${{ steps.validation.outcome == 'failure' }}
uses: ./.github/actions/error-email-action
with:
username: ${{secrets.MOMENTO_ROBOT_GMAIL_USERNAME}}
password: ${{secrets.MOMENTO_ROBOT_GMAIL_PASSWORD}}
- name: Flag Job Failure
if: ${{ steps.validation.outcome == 'failure' }}
run: exit 1