Skip to content

Initial commit

Initial commit #1

Workflow file for this run

name: Release
on:
push:
branches:
- main
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
env:
CARGO_TERM_COLOR: always
steps:
- uses: actions/checkout@v4
- name: Install Rust
run: rustup update stable
- name: Install rust dependencies
run: |
cargo install cargo-watch
cargo install commitlint-rs
- name: Setup LCOV
uses: hrishikesh-kadam/setup-lcov@v1
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Install Node.js
uses: actions/setup-node@v2
with:
node-version: "20"
- name: Install Frontend dependencies
run: |
cd src/frontend
npm install
- name: Coverage Frontend
run: |
cd src/frontend
npm run coverage
- name: Test cli
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcovCli.info --manifest-path Cargo.toml
- name: Report code coverage
if: matrix.os == 'macOS-latest'
uses: zgosalvez/[email protected]
with:
coverage-files: lcovCli.info
artifact-name: code-coverage-cli-report
github-token: ${{ secrets.GITHUB_TOKEN }}
update-comment: true
title-prefix: "CLI"
- name: Test Backend
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcovBackend.info --manifest-path src/backend/Cargo.toml
- name: Report code coverage
if: matrix.os == 'macOS-latest'
uses: zgosalvez/[email protected]
with:
coverage-files: lcovBackend.info
artifact-name: code-coverage-backend-report
github-token: ${{ secrets.GITHUB_TOKEN }}
update-comment: true
title-prefix: "BACKEND"
- name: Run Project Build
run: cargo run -- --build --prod-astro-build=true
- name: Package Artifacts (Linux)
if: matrix.os == 'linux-latest'
run: |
zip -r artifacts_linux.zip .
mkdir -p artifacts
mv artifacts_linux.zip artifacts/
- name: Package Artifacts (Mac)
if: matrix.os == 'macOs-latest'
run: |
zip -r artifacts_macos.zip .
mkdir -p artifacts
mv artifacts_macos.zip artifacts/
- name: Package Artifacts (Windows)
if: matrix.os == 'window-latest'
run: |
Compress-Archive -Path . -DestinationPath artifacts\artifacts_windows.zip
mkdir artifacts
copy artifacts_windows.zip artifacts\
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: build-artifacts
path: artifacts/
release:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download Artifacts
uses: actions/[email protected]
with:
name: build-artifacts
path: artifacts/
- name: Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
draft: false
prerelase: false
tag_name: v0.1.2.${{github.run_number}}
files: |
artifacts/arifacts_macos.zip
artifacts/arifacts_windows.zip
artifacts/arifacts_linux.zip