Skip to content

Commit

Permalink
add basic ci for mac/linux
Browse files Browse the repository at this point in the history
  • Loading branch information
rauljordan committed Feb 1, 2024
1 parent 35ab1b0 commit 10535c0
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## Description

Please provide a summary of the changes and any backward incompatibilities.

## Checklist

- [ ] I have documented these changes where necessary.
- [ ] I have read the [DCO][DCO] and ensured that these changes comply.
- [ ] I assign this work under its [open source licensing][terms].

[DCO]: licenses/DCO.txt
[terms]: licenses/COPYRIGHT.md
34 changes: 34 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: linux
on:
push:
branches:
- main
pull_request:
workflow_dispatch:

jobs:
test:
runs-on: ubuntu-latest
name: (${{ matrix.target }}, ${{ matrix.cfg_release_channel }})
env:
CFG_RELEASE_CHANNEL: ${{ matrix.cfg_release_channel }}
strategy:
matrix:
target: [
x86_64-unknown-linux-gnu,
]
cfg_release_channel: [nightly, stable]

steps:
- name: checkout
uses: actions/checkout@v3

# Run build
- name: install rustup
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup-init.sh
sh rustup-init.sh -y --default-toolchain none
rustup target add ${{ matrix.target }}
- name: Build and Test
run: ./ci/build_and_test.sh
35 changes: 35 additions & 0 deletions .github/workflows/mac.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: mac
on:
push:
branches:
- main
pull_request:
workflow_dispatch:

jobs:
test:
runs-on: macos-latest
name: (${{ matrix.target }}, ${{ matrix.cfg_release_channel }})
env:
CFG_RELEASE_CHANNEL: ${{ matrix.cfg_release_channel }}
strategy:
fail-fast: false
matrix:
target: [
aarch64-apple-darwin,
]
cfg_release_channel: [nightly, stable]

steps:
- name: checkout
uses: actions/checkout@v3

# Run build
- name: install rustup
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup-init.sh
sh rustup-init.sh -y --default-toolchain none
rustup target add ${{ matrix.target }}
- name: Build and Test
run: ./ci/build_and_test.sh
18 changes: 18 additions & 0 deletions ci/build_and_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

set -euo pipefail

export RUSTFLAGS="-D warnings"
export RUSTFMT_CI=1

# Print version information
rustc -Vv
cargo -V

# Build and test main crate
if [ "$CFG_RELEASE_CHANNEL" == "nightly" ]; then
cargo build --locked --all-features
else
cargo build --locked
fi
cargo test --all-features

0 comments on commit 10535c0

Please sign in to comment.