build: add CI for pull requests

This commit is contained in:
Alex Shelkovnykov 2023-03-04 17:23:40 +09:00
parent f4bbc255f0
commit e585fe422f
4 changed files with 57 additions and 28 deletions

14
.github/workflows/ares-feature.yml vendored Normal file
View File

@ -0,0 +1,14 @@
name: 'Ares: Pull request'
on:
pull_request:
paths:
- '.github/workflows/ares-feature.yml'
- '.github/workflows/ares-shared.yml'
- 'rust/ares/**'
- 'rust/ares_macros/**'
- 'rust/ibig-rs/**'
jobs:
urbit:
uses: ./.github/workflows/ares-shared.yml

27
.github/workflows/ares-shared.yml vendored Normal file
View File

@ -0,0 +1,27 @@
on:
workflow_call:
env:
CARGO_TERM_COLOR: always
defaults:
run:
working-directory: rust/ares
jobs:
build:
strategy:
matrix:
os: [ 'ubuntu-latest', 'macos-latest' ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Format
run: cargo fmt --check
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose

16
.github/workflows/ares-status.yml vendored Normal file
View File

@ -0,0 +1,16 @@
name: 'Ares: Push to status'
on:
push:
branches:
- status
paths:
- '.github/workflows/ares-shared.yml'
- '.github/workflows/ares-status.yml'
- 'rust/ares/**'
- 'rust/ares_macros/**'
- 'rust/ibig-rs/**'
jobs:
urbit:
uses: ./.github/workflows/ares-shared.yml

View File

@ -1,28 +0,0 @@
name: Ares
on:
push:
branches: [ "status" ]
pull_request:
branches: [ "status" ]
env:
CARGO_TERM_COLOR: always
defaults:
run:
working-directory: rust/ares
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Format
run: cargo fmt --check
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose