Skip to content

Merge pull request #37 from monofox/feature/linkify #122

Merge pull request #37 from monofox/feature/linkify

Merge pull request #37 from monofox/feature/linkify #122

Workflow file for this run

name: Rust
on:
workflow_call:
inputs:
upload-tag:
type: string
default: "nightly"
push:
branches: [ "main", "main-dev" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
jobs:
test_and_coverage:
name: Test and create coverage report.
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Taskwarrior
run: |
sudo apt-get update
echo "confirmation=off" | sudo tee -a /root/.taskrc
sudo DEBIAN_FRONTEND=noninteractive apt-get -yq install taskwarrior
echo "yes" | task || true
- name: Run Tests and Upload Coverage
uses: Reloaded-Project/devops-rust-test-and-coverage@v1
with:
setup-rust-cache: true
rust-project-path: '.'
rust-toolchain: 'nightly'
use-tarpaulin: true
upload-coverage: false
target: 'x86_64-unknown-linux-gnu'
- uses: actions/upload-artifact@v4
with:
name: "Coverage report"
path: cobertura.xml
build:
runs-on: ubuntu-latest
steps:
- name: Get current date
id: date
run: echo "BUILD_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: Set env
run: |
echo "TAG_NAME=${{ env.BUILD_DATE }}" >> $GITHUB_ENV
echo "RELEASE_NAME=${{ env.BUILD_DATE }}" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v4
- name: Setup rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly
- name: Cache
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Building
run: |
cargo build --release
cp target/release/taskwarrior-web taskwarrior-web
tar czf tw-web-${{ env.RELEASE_NAME }}.tar.gz dist taskwarrior-web
- name: Release
uses: softprops/action-gh-release@v2
if: ${{ github.event_name != 'pull_request' }}
with:
prerelease: true
tag_name: ${{ env.TAG_NAME }}
files: tw-web-${{ env.RELEASE_NAME }}.tar.gz