diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000..b33d4bb --- /dev/null +++ b/.github/workflows/check.yml @@ -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 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..e0e4870 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,21 @@ +on: + push: + 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 --dry-run diff --git a/publish.sh b/publish.sh new file mode 100755 index 0000000..830ed86 --- /dev/null +++ b/publish.sh @@ -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 +echo "Executing: ${cmd}; in $(pwd)" +$cmd || exit +cd ../scudo-sys || exit +echo "Executing: ${cmd}; in $(pwd)" +$cmd || exit +cd ../scudo || exit +echo "Executing: ${cmd}; in $(pwd)" +$cmd || exit +cd .. || exit