Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.local
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_API_BASE_URL=http://0.0.0.0:3000
52 changes: 52 additions & 0 deletions .github/workflows/publish_crate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Publish crate

on:
push:
tags:
- "v*"

jobs:
check-secret:
runs-on: ubuntu-latest
environment: crates-io-torrust
outputs:
publish: ${{ steps.check.outputs.publish }}
steps:
- id: check
env:
CRATES_TOKEN: "${{ secrets.CRATES_TOKEN }}"
if: "${{ env.CRATES_TOKEN != '' }}"
run: echo "publish=true" >> $GITHUB_OUTPUT

test:
needs: check-secret
if: needs.check-secret.outputs.publish == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: llvm-tools-preview
- uses: Swatinem/rust-cache@v2
- name: Run Tests
run: cargo test

publish:
needs: test
if: needs.check-secret.outputs.publish == 'true'
runs-on: ubuntu-latest
environment: crates-io-torrust
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable

- name: Publish workspace packages
run: cargo publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_TOKEN }}
59 changes: 59 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Test

on: [push, pull_request]

jobs:
format:
runs-on: ubuntu-latest
env:
CARGO_TERM_COLOR: always
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- name: Check Rust Formatting
run: cargo fmt --check

test:
needs: format
runs-on: ubuntu-latest
env:
CARGO_TERM_COLOR: always
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: llvm-tools-preview
- uses: Swatinem/rust-cache@v2
- name: Check Rust Code
run: cargo check --all-targets
- name: Clippy Rust Code
run: cargo clippy --all-targets -- -D clippy::pedantic
- name: Run Tests
run: cargo test --workspace
- uses: taiki-e/install-action@cargo-llvm-cov
- uses: taiki-e/install-action@nextest
- name: Show coverage
run: cargo llvm-cov nextest

build:
needs: test
if: |
github.event_name == 'push' &&
github.event.base_ref == 'refs/heads/main' &&
startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
env:
CARGO_TERM_COLOR: always
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- uses: Swatinem/rust-cache@v2
- name: Build
run: cargo build --release
8 changes: 5 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/node_modules/
/dist/
/.env
/.idea/
/.env*
/dist/
/node_modules/
/target/
config.toml
Loading