Skip to content

Commit

Permalink
ci(github): Add GitHub Actions workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Holzhaus committed Oct 3, 2024
1 parent cc0c60a commit 4932c2a
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 1 deletion.
16 changes: 16 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Build
on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Print Rust version
run: rustc -vV
- name: Run tests
run: cargo test --all-features --verbose
- name: Run bench
run: cargo bench --all-features --verbose
- name: Run doc
run: cargo doc --all-features --verbose
42 changes: 42 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: pre-commit

on:
push:
pull_request:

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v2
with:
fetch-depth: 2

- name: Generate Cargo.lock
uses: actions-rs/cargo@v1
with:
command: generate-lockfile

- name: Set up Python
uses: actions/setup-python@v2

- name: Detect code style issues
uses: pre-commit/[email protected]
env:
SKIP: no-commit-to-branch

- name: Generate patch file
if: failure()
run: |
git diff-index -p HEAD > "${PATCH_FILE}"
[ -s "${PATCH_FILE}" ] && echo "UPLOAD_PATCH_FILE=${PATCH_FILE}" >> "${GITHUB_ENV}"
env:
PATCH_FILE: pre-commit.patch

- name: Upload patch artifact
if: failure() && env.UPLOAD_PATCH_FILE != null
uses: actions/upload-artifact@v2
with:
name: ${{ env.UPLOAD_PATCH_FILE }}
path: ${{ env.UPLOAD_PATCH_FILE }}
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Helicon [![License][license-badge]][license]
# Helicon [![License][license-badge]][license] [![Build Status][build-badge]][build]

Helicon is a command-line tool to tag and organize your music based on metadata
from [MusicBrainz][musicbrainz], written in Rust.
Expand All @@ -20,3 +20,5 @@ This software is [licensed][license] under the terms of the [Mozilla Public Lice
[musicbrainz]: https://musicbrainz.org/
[license]: https://github.com/Holzhaus/helicon/blob/main/COPYING
[license-badge]: https://img.shields.io/github/license/Holzhaus/helicon
[build]: https://github.com/Holzhaus/helicon/actions?query=branch%3Amain
[build-badge]: https://img.shields.io/github/workflow/status/Holzhaus/helicon/Build

0 comments on commit 4932c2a

Please sign in to comment.