Skip to content

Commit

Permalink
Add GH Actions workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Sejsel committed Feb 19, 2024
1 parent e7742e0 commit 21d807d
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Prepare CLI release

# Only do the release on x.y.z tags.
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"
workflow_dispatch:

env:
CARGO_TERM_COLOR: always

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- original_name: ksplang-cli.exe
fixed_name: ksplang.exe
os: windows-latest
- original_name: ksplang-cli
fixed_name: ksplang
os: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build
run: cargo build -p ksplang-cli --verbose --release
- name: Run library tests
run: cargo test --verbose
- name: Run CLI tests
run: cargo test -p ksplang-cli --verbose
- name: Rename executable
run: |
mv target/release/${{ matrix.original_name }} target/release/${{ matrix.fixed_name }}
- name: Release
uses: softprops/action-gh-release@v1
with:
draft: true
files: target/release/${{ matrix.fixed_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19 changes: 19 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Tests

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose

0 comments on commit 21d807d

Please sign in to comment.