-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from adnanjpg/gh-actions
test: add a ci action
- Loading branch information
Showing
3 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# a composite action, as described here: | ||
# https://docs.github.com/en/actions/creating-actions/creating-a-composite-action | ||
name: "Build and test app" | ||
description: "Build and test app on different platforms" | ||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: ⚡ Cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.cargo/registry | ||
~/.cargo/git | ||
target | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
|
||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
|
||
- name: 🔨 Build | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: build | ||
args: --release --all-features | ||
|
||
- name: 🔎 Test | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
args: --release | ||
|
||
# https://stackoverflow.com/a/64702025/12555423 | ||
# these will be used once we add integration tests | ||
# - name: ⚙ Integration test | ||
# uses: actions-rs/cargo@v1 | ||
# with: | ||
# command: test | ||
# args: --release --features "integration_tests" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
on: [pull_request] | ||
|
||
name: CI for pull requests | ||
|
||
jobs: | ||
# https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2204-Readme.md | ||
build_and_test_ubuntu: | ||
name: Build and test on Ubuntu | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- id: build_and_test | ||
uses: ./.github/build-and-test | ||
|
||
# https://github.com/actions/runner-images/blob/main/images/windows/Windows2022-Readme.md | ||
build_and_test_windows: | ||
name: Build and test on Windows | ||
runs-on: windows-2022 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- id: build_and_test | ||
uses: ./.github/build-and-test | ||
|
||
# https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md | ||
build_and_test_macos: | ||
name: Build and test on macOS | ||
runs-on: macos-13 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- id: build_and_test | ||
uses: ./.github/build-and-test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
on: [push] | ||
|
||
name: CI for push | ||
|
||
jobs: | ||
build_and_test_ubuntu: | ||
name: Build and test on Ubuntu | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Build and test on ubuntu | ||
uses: ./.github/build-and-test |