chore: Add GitHub Actions workflows

Signed-off-by: Christoph Heiss <contact@christoph-heiss.at>
This commit is contained in:
Christoph Heiss 2022-08-04 13:17:58 +02:00
parent c1bdaa9ec2
commit 3ae082673c
Signed by: c8h4
GPG key ID: 9C82009BEEDEA0FF
2 changed files with 118 additions and 0 deletions

51
.github/workflows/builds.yml vendored Normal file
View file

@ -0,0 +1,51 @@
name: Release builds
on:
push:
branches:
- main
- dev
pull_request:
env:
RUSTFLAGS: -D warnings
CARGO_TERM_COLOR: always
jobs:
linux-x86_64-release:
name: Linux release build (x86_64)
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Install required system libraries
run: |
sudo apt-get update \
&& sudo apt-get install libxcb-shape0-dev libxcb-xfixes0-dev
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- uses: actions-rs/cargo@v1
with:
command: build
args: --release
- uses: actions/upload-artifact@v3
with:
name: bwtui_linux_x86_64
path: target/release/bwtui

67
.github/workflows/test.yml vendored Normal file
View file

@ -0,0 +1,67 @@
name: Test
on:
push:
branches:
- main
- dev
pull_request:
env:
RUSTFLAGS: -D warnings
CARGO_TERM_COLOR: always
jobs:
build-and-test:
name: Build, test, doc, clippy
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
matrix:
toolchain:
- stable
- nightly
steps:
- name: Install required system libraries
run: |
sudo apt-get update \
&& sudo apt-get install libxcb-shape0-dev libxcb-xfixes0-dev
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
components: clippy
override: true
- uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
- name: Generate rustdoc
uses: actions-rs/cargo@v1
with:
command: doc
- name: Run clippy
uses: actions-rs/cargo@v1
with:
command: clippy