-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (42 loc) · 1.23 KB
/
build_and_test_bot.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
on:
workflow_call:
inputs:
release:
required: true
type: boolean
upload-artifact:
required: true
type: boolean
secrets:
SHEET_ID:
required: true
jobs:
build_and_test_bot:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Download the table
if: inputs.release
run: curl -L "docs.google.com/spreadsheets/d/${{ secrets.SHEET_ID }}/gviz/tq?tqx=out:csv&sheet=Ukrainian" -o table.csv
- name: Test and build release
if: inputs.release
env:
SHEET_ID: ${{ secrets.SHEET_ID }}
RUST_LOG: info
run: cargo test --release -- --nocapture && cargo build --release
- name: Test and build debug
if: ${{ !inputs.release }}
env:
SHEET_ID: ${{ secrets.SHEET_ID }}
RUST_LOG: info
run: cargo test -- --nocapture && cargo build
- name: Move binary
if: inputs.upload-artifact
run: mv target/*/bot target
- uses: actions/upload-artifact@v3
if: inputs.upload-artifact
with:
name: executable
path: target/bot