Skip to content

Commit

Permalink
Add github action to build/test/publish dap-rs
Browse files Browse the repository at this point in the history
  • Loading branch information
sztomi committed Jul 13, 2023
1 parent 5c19f05 commit 4d1dd8b
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Rust

on:
push:
branches: [ "main" ]
tags:
- '*'
pull_request:
branches: [ "main" ]
create:
tags:
- '*'

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

publish:
needs: build
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Login to Crates.io
uses: actions-rs/cargo@v1
with:
command: login
args: ${{ secrets.CRATES_IO_TOKEN }}

- name: Publish to Crates.io
uses: actions-rs/cargo@v1
with:
command: publish

0 comments on commit 4d1dd8b

Please sign in to comment.