From f7d7b86de6fa0521b3d0a6bc7ad772628b5b2c5d Mon Sep 17 00:00:00 2001 From: Dmitry Murzin Date: Sun, 28 Jan 2024 20:33:44 +0200 Subject: [PATCH] Run tests on CI --- .github/workflows/check.yml | 20 ++++++++++++++++++++ README.md | 3 ++- src/github.rs | 4 ++-- 3 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/check.yml diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000..e2496f3 --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,20 @@ +name: check + +on: + workflow_dispatch: + schedule: + # every day at 03:45 UTC + - cron: "45 03 * * *" + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Build + run: cargo build --verbose + - name: Run tests + run: cargo test --verbose diff --git a/README.md b/README.md index c63143d..1b887da 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,10 @@ # Translate your Factorio mod easily with the power of Crowdin +[![Crowdin](https://badges.crowdin.net/factorio-mods-localization/localized.svg)](https://crowdin.com/project/factorio-mods-localization) [![Website factorio-mods-localization.herokuapp.com](https://img.shields.io/website-up-down-green-red/https/factorio-mods-localization.herokuapp.com.svg)](https://factorio-mods-localization.herokuapp.com/) +[![GitHub Actions Status](https://img.shields.io/github/actions/workflow/status/dima74/factorio-mods-localization/check.yml)](https://github.com/dima74/factorio-mods-localization/actions/workflows/check.yml) [![GitHub license](https://img.shields.io/github/license/dima74/factorio-mods-localization.svg)](https://github.com/dima74/factorio-mods-localization/blob/master/LICENSE) [![GitHub issues](https://img.shields.io/github/issues/dima74/factorio-mods-localization.svg)](https://GitHub.com/dima74/factorio-mods-localization/issues/) -[![Crowdin](https://badges.crowdin.net/factorio-mods-localization/localized.svg)](https://crowdin.com/project/factorio-mods-localization) ## Description We provide service for simplifying [Factorio](https://www.factorio.com/) mods translation. You only need to install [our GitHub app][1]. After this, the following actions will be performed automatically: diff --git a/src/github.rs b/src/github.rs index ad8db7a..5c8f0ba 100644 --- a/src/github.rs +++ b/src/github.rs @@ -16,8 +16,8 @@ pub const GITHUB_BRANCH_NAME: &str = "crowdin-fml"; const MAX_PER_PAGE: u8 = 100; fn get_credentials() -> (AppId, EncodingKey) { - let github_app_id: u64 = dotenv::var("GITHUB_APP_ID").unwrap().parse().unwrap(); - let github_app_key = dotenv::var("GITHUB_APP_PRIVATE_KEY").unwrap().replace("\\n", "\n"); + let github_app_id: u64 = dotenv::var("MY_GITHUB_APP_ID").unwrap().parse().unwrap(); + let github_app_key = dotenv::var("MY_GITHUB_APP_PRIVATE_KEY").unwrap().replace("\\n", "\n"); let github_app_key = EncodingKey::from_rsa_pem(github_app_key.as_bytes()).unwrap(); (AppId(github_app_id), github_app_key) }