Skip to content

Commit 85bb084

Browse files
committed
Add triagebot benchmark
1 parent 9cae27a commit 85bb084

File tree

123 files changed

+81565
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+81565
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/target
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# if `GITHUB_TOKEN` is not set here, the token can also be stored in `~/.gitconfig`
2+
GITHUB_TOKEN=MUST_BE_CONFIGURED
3+
DATABASE_URL=MUST_BE_CONFIGURED
4+
GITHUB_WEBHOOK_SECRET=MUST_BE_CONFIGURED
5+
# for logging, refer to this document: https://rust-lang-nursery.github.io/rust-cookbook/development_tools/debugging/config_log.html
6+
# `RUSTC_LOG` is not required to run the application, but it makes local development easier
7+
# RUST_LOG=MUST_BE_CONFIGURED
8+
9+
# If you are running a bot on non-rustbot account,
10+
# this allows to configure that username which the bot will respond to.
11+
# For example write blahblahblah here, if you want for this bot to
12+
# respond to @blahblahblah claim.
13+
# TRIAGEBOT_USERNAME=CAN_BE_CONFIGURED
14+
15+
# Set your own Zulip instance (local testing only)
16+
# ZULIP_URL=https://testinstance.zulichat.com
17+
18+
# Used for authenticating a bot
19+
20+
# ZULIP_API_TOKEN=yyy
21+
22+
# Authenticates inbound webhooks from Github
23+
# ZULIP_WEBHOOK_SECRET=xxx
24+
25+
# Use another endpoint to retrieve teams of the Rust project (useful for local testing)
26+
# default: https://team-api.infra.rust-lang.org/v1
27+
# TEAMS_API_URL=http://localhost:8080
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: CI
2+
on:
3+
pull_request:
4+
merge_group:
5+
6+
env:
7+
AWS_ACCESS_KEY_ID: AKIA46X5W6CZEAQSMRH7
8+
9+
jobs:
10+
test:
11+
name: Test
12+
runs-on: ubuntu-latest
13+
env:
14+
TEST_DB_URL: postgres://postgres:postgres@localhost:5432/postgres
15+
services:
16+
postgres:
17+
image: postgres:14
18+
env:
19+
POSTGRES_USER: postgres
20+
POSTGRES_PASSWORD: postgres
21+
POSTGRES_DB: postgres
22+
ports:
23+
- 5432:5432
24+
steps:
25+
- uses: actions/checkout@v4
26+
- run: rustup toolchain install stable --profile minimal
27+
- uses: Swatinem/rust-cache@v2
28+
- name: Run tests
29+
run: cargo test --workspace --all-targets
30+
- name: Check formatting
31+
run: cargo fmt --all --check
32+
33+
deploy:
34+
name: Deploy
35+
runs-on: ubuntu-latest
36+
needs: [ test ]
37+
if: github.event_name == 'merge_group'
38+
steps:
39+
- name: Checkout the source code
40+
uses: actions/checkout@v4
41+
42+
- name: Test and build
43+
run: docker build -t triagebot .
44+
45+
- name: Deploy to production
46+
uses: rust-lang/simpleinfra/github-actions/upload-docker-image@master
47+
with:
48+
image: triagebot
49+
repository: rust-triagebot
50+
region: us-west-1
51+
redeploy_ecs_cluster: rust-ecs-prod
52+
redeploy_ecs_service: triagebot
53+
aws_access_key_id: "${{ env.AWS_ACCESS_KEY_ID }}"
54+
aws_secret_access_key: "${{ secrets.AWS_SECRET_ACCESS_KEY }}"
55+
56+
# Summary job for the merge queue.
57+
# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
58+
ci:
59+
needs: [ test, deploy ]
60+
# We need to ensure this job does *not* get skipped if its dependencies fail,
61+
# because a skipped job is considered a success by GitHub. So we have to
62+
# overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run
63+
# when the workflow is canceled manually.
64+
if: ${{ !cancelled() }}
65+
runs-on: ubuntu-latest
66+
steps:
67+
# Manually check the status of all dependencies. `if: failure()` does not work.
68+
- name: Conclusion
69+
run: |
70+
# Print the dependent jobs to see them in the CI log
71+
jq -C <<< '${{ toJson(needs) }}'
72+
# Check if all jobs that we depend on (in the needs array) were successful.
73+
jq --exit-status 'all(.result == "success" or .result == "skipped")' <<< '${{ toJson(needs) }}'
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/target
2+
**/*.rs.bk
3+
.env

0 commit comments

Comments
 (0)