Skip to content

Commit

Permalink
Merge pull request #1 from birlug/ci
Browse files Browse the repository at this point in the history
deploy faster than brewing a cup of joe!
  • Loading branch information
amiremohamadi authored May 13, 2024
2 parents 5fbc363 + bd2fb4a commit 482e12c
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
43 changes: 43 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: CI/CD

on:
push:
branches:
- main
paths-ignore:
- 'README.md'
- 'LICENSE.md'
pull_request:
branches:
- main
paths-ignore:
- 'README.md'
- 'LICENSE.md'

env:
CARGO_TERM_COLOR: always

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: running tests
run: cargo test --verbose

deploy:
runs-on: ubuntu-latest
environment: wiseass
needs: test
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v3
- name: prepare env
run: touch .env
- name: deploy
run: make deploy
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
KV_BINDING: ${{ secrets.KV_BINDING }}
KV_ID: ${{ secrets.KV_ID }}
2 changes: 1 addition & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ mod tests {
let config = include_str!("../config-example.toml");
let result: Config = toml::from_str(config).unwrap();

assert_eq!(result.bot.admin_users_id, [7357]);
assert_eq!(result.bot.admin_users_id, [UserId(7357)]);
assert_eq!(result.bot.report_chat_id, ChatId(7357));
}
}

0 comments on commit 482e12c

Please sign in to comment.