Update the logging interface #409
Workflow file for this run
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
name: CI | |
on: | |
push: | |
# Avoid duplicate builds on PRs. | |
branches: | |
- main | |
pull_request: | |
permissions: | |
contents: read | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
lint: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Update Rust toolchain | |
run: rustup update | |
- name: Rust Cache | |
uses: Swatinem/[email protected] | |
- name: Clippy | |
run: cargo clippy --all-targets --locked -- --deny warnings | |
- name: rustfmt | |
run: cargo fmt -- --check | |
unit-test: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Update Rust toolchain | |
run: rustup update | |
- name: Rust Cache | |
uses: Swatinem/[email protected] | |
- name: Run unit tests | |
run: cargo test --locked | |
integration-test: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install musl-tools | |
run: sudo apt-get install musl-tools --no-install-recommends | |
- name: Update Rust toolchain | |
run: rustup update | |
- name: Install Rust linux-musl target | |
run: rustup target add x86_64-unknown-linux-musl | |
- name: Rust Cache | |
uses: Swatinem/[email protected] | |
- name: Install Pack CLI | |
uses: buildpacks/github-actions/[email protected] | |
- name: Run integration tests | |
# Runs only tests annotated with the `ignore` attribute (which in this repo, are the integration tests). | |
run: cargo test --locked -- --ignored | |
print-pack-getting-started-output: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install musl-tools | |
run: sudo apt-get install musl-tools --no-install-recommends | |
- name: Update Rust toolchain | |
run: rustup update | |
- name: Install Rust linux-musl target | |
run: rustup target add x86_64-unknown-linux-musl | |
- name: Rust Cache | |
uses: Swatinem/[email protected] | |
- name: Install Pack CLI | |
uses: buildpacks/github-actions/[email protected] | |
- name: Pull builder image | |
run: | | |
docker pull "heroku/builder:22" | |
docker pull "heroku/heroku:22-cnb" | |
- name: Clone ruby getting started guide | |
run: mkdir tmp; git clone https://github.com/heroku/ruby-getting-started tmp/ruby-getting-started | |
- name: Install libcnb-cargo for `cargo libcnb package` command | |
run: cargo install libcnb-cargo | |
- name: Compile ruby buildpack | |
run: cargo libcnb package | |
- name: "PRINT: Getting started guide output" | |
run: | # Use `script -e -c` to pretend to be a TTY for pack terminal color support | |
script -e -c "pack build my-image --builder heroku/builder:22 --buildpack heroku/nodejs-engine --buildpack packaged/x86_64-unknown-linux-musl/debug/heroku_ruby --path tmp/ruby-getting-started --pull-policy never" | |
print-style-guide: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install musl-tools | |
run: sudo apt-get install musl-tools --no-install-recommends | |
- name: Update Rust toolchain | |
run: rustup update | |
- name: Install Rust linux-musl target | |
run: rustup target add x86_64-unknown-linux-musl | |
- name: Rust Cache | |
uses: Swatinem/[email protected] | |
- name: Build binary | |
run: cargo build --bin print_style_guide | |
- name: "PRINT: Style guide" | |
run: | # Use `script -e -c` to pretend to be a TTY for pack terminal color support | |
script -e -c "cargo run --bin print_style_guide" |