-
Notifications
You must be signed in to change notification settings - Fork 37
91 lines (90 loc) · 3.22 KB
/
tests-and-formatting.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
name: Tests and Formatting
on:
workflow_dispatch:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
tests-and-formatting:
name: Rust/JS Checks/Formatting
runs-on: ubuntu-latest
env:
FASTN_DB_URL: sqlite:///test.sqlite
DEBUG: true
FASTN_ENABLE_AUTH: true
FASTN_ENABLE_EMAIL: false
steps:
- name: Check out
uses: actions/checkout@v4
# - name: Set up cargo cache
# uses: actions/cache@v3 # there is also https://github.com/Swatinem/rust-cache
# continue-on-error: false
# with:
# path: |
# ~/.cargo/registry/index/
# ~/.cargo/registry/cache/
# ~/.cargo/git/db/
# target/
# key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
# restore-keys: ${{ runner.os }}-cargo-
- name: Run cargo fmt
id: fmt
run: cargo fmt --all -- --check
continue-on-error: true
- name: Run cargo clippy
id: clippy
continue-on-error: true
run: cargo clippy --all -- -D warnings
# - name: Install cargo check tools
# run: |
# cargo install --locked cargo-deny || true
# cargo install --locked cargo-outdated || true
# cargo install --locked cargo-udeps || true
# cargo install --locked cargo-audit || true
# cargo install --locked cargo-pants || true
# - name: Check
# run: |
# cargo deny check
# cargo outdated --exit-code 1
# cargo udeps
# rm -rf ~/.cargo/advisory-db
# cargo audit
# cargo pants
- name: Run cargo test
# cd fastn-core && fbt -f
# cargo test html_test_all -- --nocapture fix=true
# cargo test fastn_js_test_all -- --nocapture fix=true
# cargo test p1_test_all -- --nocapture fix=true
# cargo test interpreter_test_all -- --nocapture fix=true
# cargo test executor_test_all -- --nocapture fix=true
id: test
continue-on-error: true
run: cargo test
# - name: Run integration tests
# id: integration-test
# continue-on-error: true
# run: |
# bash .github/scripts/run-integration-tests.sh
- name: Check if JS code is properly formatted
# curl -fsSL https://dprint.dev/install.sh | sh
# /Users/amitu/.dprint/bin/dprint fmt --config .github/dprint-ci.json
id: js-fmt
uses: dprint/[email protected]
with:
config-path: .github/dprint-ci.json
- name: Check if code is properly formatted
if: steps.fmt.outcome != 'success'
run: exit 1
- name: Check if clippy is happy
if: steps.clippy.outcome != 'success'
run: exit 1
- name: Check if js-fmt is happy
if: steps.js-fmt.outcome != 'success'
run: exit 1
- name: Check if test succeeded
if: steps.test.outcome != 'success'
run: exit 1
# - name: Check if integration test passed
# if: steps.integration-test.outcome != 'success'
# run: exit 1