-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
169 additions
and
210 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,97 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
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/rust-cache@v2 | ||
- 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/rust-cache@v2 | ||
- name: Run unit tests | ||
run: cargo test --locked | ||
|
||
libcnb-test: | ||
name: Cargo integration tests (${{ matrix.integration-test-cnb-builder }}) | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
matrix: | ||
integration-test-cnb-builder: [ "heroku/buildpacks:20", "heroku/builder:22" ] | ||
env: | ||
INTEGRATION_TEST_CNB_BUILDER: ${{ matrix.integration-test-cnb-builder }} | ||
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/rust-cache@v2 | ||
- 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 | ||
|
||
cutlass-test: | ||
name: Cutlass (${{ matrix.spec-dir }} on ${{ matrix.integration-test-cnb-builder }}) | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
matrix: | ||
integration-test-cnb-builder: ["heroku/buildpacks:20", "heroku/builder:22"] | ||
spec-dir: ["test/specs/java", "test/specs/java-function"] | ||
env: | ||
INTEGRATION_TEST_CNB_BUILDER: ${{ matrix.integration-test-cnb-builder }} | ||
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/rust-cache@v2 | ||
- name: Install libcnb-cargo | ||
run: cargo install libcnb-cargo | ||
- name: Install Pack CLI | ||
uses: buildpacks/github-actions/[email protected] | ||
- name: Install Ruby and dependencies | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
bundler-cache: true | ||
ruby-version: "2.7" | ||
- name: Run integration tests | ||
run: bundle exec rspec ${{ matrix.spec-dir }} |
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
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
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
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
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 |
---|---|---|
|
@@ -9,6 +9,7 @@ use libcnb::exec_d::write_exec_d_program_output; | |
use std::collections::HashMap; | ||
use url::Url; | ||
|
||
#[allow(clippy::missing_panics_doc)] | ||
pub fn main() { | ||
write_exec_d_program_output( | ||
jvm_env_vars_for_env(&std::env::vars().collect()) | ||
|
@@ -352,7 +353,7 @@ mod test { | |
String::from("postgres://pooluser:[email protected]:5432/testdb"), | ||
)])); | ||
|
||
assert_eq!(result, HashMap::new()) | ||
assert_eq!(result, HashMap::new()); | ||
} | ||
|
||
#[test] | ||
|
@@ -466,7 +467,7 @@ mod test { | |
String::from("postgres://test123@ec2-52-13-12"), | ||
)])); | ||
|
||
assert_eq!(result, HashMap::new()) | ||
assert_eq!(result, HashMap::new()); | ||
} | ||
|
||
#[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
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
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
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
Oops, something went wrong.