Skip to content

Moving Value, PropertyValue, Component, Record and Variable to fastn-type #15

Moving Value, PropertyValue, Component, Record and Variable to fastn-type

Moving Value, PropertyValue, Component, Record and Variable to fastn-type #15

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