Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Github action #5

Merged
merged 1 commit into from
Jan 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
on:
push:
branches:
- "main"
pull_request:

name: check
jobs:
fmt:
runs-on: ubuntu-latest
name: Check
permissions:
checks: write
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
components: rustfmt
- name: cargo fmt --check
uses: actions-rs/cargo@v1
with:
command: fmt
args: --check
- name: cargo clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}

test:
runs-on: ubuntu-latest
name: Run test suite
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install nightly
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
default: true
- name: cargo test
uses: actions-rs/cargo@v1
with:
command: test
args: --all-features
- name: Run abort tests
run: ./abort_tests.sh
20 changes: 20 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
on:
1c3t3a marked this conversation as resolved.
Show resolved Hide resolved
release:
types: [published]
workflow_dispatch:

name: publish
jobs:
publish:
runs-on: ubuntu-latest
name: Publish
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- run: cargo login ${CRATES_IO_TOKEN}
env:
CRATES_IO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
- run: ./publish.sh
24 changes: 24 additions & 0 deletions publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#
# This script will publish all crates in this repository. This script also provides
# a `--dry-run` option that runs `cargo publish` with the dry-run option.

cmd="cargo publish"
if [ "$1" == "--dry-run" ]; then
cmd="${cmd} --dry-run"
fi

cd scudo-proc-macros || exit 1
echo "Executing: ${cmd}; in $(pwd)"
$cmd || exit 1
cd ../scudo-sys || exit 1
echo "Executing: ${cmd}; in $(pwd)"
$cmd || exit 1
cd ../scudo || exit 1
echo "Executing: ${cmd}; in $(pwd)"
$cmd || exit 1
cd .. || exit 1