-
Notifications
You must be signed in to change notification settings - Fork 12
139 lines (112 loc) · 3.53 KB
/
test.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
137
138
139
# Coding format checker and test runner.
name: Automated tests
on:
push:
branches:
- main
pull_request:
jobs:
lint:
name: Linter
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Fetch source
uses: actions/checkout@v4
- name: Run shellcheck
run: shellcheck *.sh
- name: Install shfmt
run: go install mvdan.cc/sh/v3/cmd/shfmt@latest
- name: Run shfmt
run: ~/go/bin/shfmt --diff *.sh
- name: Install latest rust
run: rustup toolchain install stable --no-self-update --profile minimal --component clippy,rustfmt
- name: Lint
run: cargo fmt --check
- name: Clippy
run: cargo clippy --no-deps
test:
name: Test runner
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
# TODO: actions/cache@v2?
- name: Fetch source
uses: actions/checkout@v4
- name: Fetch tags required for testing
run: git fetch --tags
- name: Run cargo clippy for client project
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Run cargo clippy for stats-server project
run: cargo clippy --all-targets --all-features -- -D warnings
working-directory: stats-server
- name: Run cargo test
run: cargo test
- uses: ./.github/actions/cronjob-setup
- name: Test python cronjob_scripts
run: make test-cronjob-scripts
env:
INFLUXDB_TOKEN: ${{ secrets.INFLUXDB_TOKEN }}
e2etest:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: windows-latest
- os: macos-latest
- os: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Fetch source
uses: actions/checkout@v4
- name: Install latest rust
run: rustup toolchain install stable --no-self-update --profile minimal
- name: Test dry-run
run: cargo run -- --dry-run cargo-quickinstall
- name: Test installing and using binstall
run: |
set -euxo pipefail
cargo run -- cargo-quickinstall
cargo quickinstall -V
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Test using binstall with it already installed
run: |
set -euxo pipefail
cargo run -- cargo-quickinstall
cargo quickinstall -V
- name: Test batch installation with binstall
run: |
set -euxo pipefail
cargo run -- cargo-quickinstall [email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Try running the binary
run: |
cargo quickinstall -V
cargo nextest -V
- name: Test batch installation with binstall with force
run: |
set -euxo pipefail
echo Rm all binaries installed but do not update manifests,
echo so that binstall will think they are installed.
rm $(which cargo-quickinstall) $(which [email protected])
cargo run -- --force cargo-quickinstall [email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Try running the binary
run: |
cargo quickinstall -V
cargo nextest -V
- name: Test batch installation with curl
run: |
set -euxo pipefail
cargo run -- --no-binstall cargo-quickinstall [email protected]
cargo quickinstall -V
cargo nextest -V