Skip to content

Commit

Permalink
Initial libcnb.rs skeleton with integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
mars committed Sep 20, 2024
0 parents commit e9b9efc
Show file tree
Hide file tree
Showing 19 changed files with 1,716 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: CI

on:
push:
branches: ["main"]
pull_request:

permissions:
contents: read

jobs:

rust-lint:
runs-on: sfdc-hk-ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- 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

rust-unit-test:
runs-on: sfdc-hk-ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Update Rust toolchain
run: rustup update
- name: Rust Cache
uses: Swatinem/[email protected]
- name: Run unit tests
run: cargo test --locked

rust-integration-test:
runs-on: sfdc-hk-ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install musl-tools
run: sudo apt-get install musl-tools -y --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
run: cargo test --locked -- --ignored --test-threads 16
23 changes: 23 additions & 0 deletions .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Prepare Buildpack Releases

on:
workflow_dispatch:
inputs:
bump:
description: "Bump"
required: true
default: 'patch'
type: choice
options:
- major
- minor
- patch

jobs:
prepare-release:
uses: heroku/languages-github-actions/.github/workflows/_buildpacks-prepare-release.yml@latest
with:
app_id: ${{ vars.LINGUIST_GH_APP_ID }}
bump: ${{ inputs.bump }}
secrets:
app_private_key: ${{ secrets.LINGUIST_GH_PRIVATE_KEY }}
22 changes: 22 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Release Buildpacks

on:
workflow_dispatch:
inputs:
dry_run:
description: Execute the release workflow but skip any steps that publish (for testing purposes)
type: boolean
default: false

jobs:
release:
name: Release
uses: heroku/languages-github-actions/.github/workflows/_buildpacks-release.yml@latest
with:
app_id: ${{ vars.LINGUIST_GH_APP_ID }}
dry_run: ${{ inputs.dry_run }}
secrets:
app_private_key: ${{ secrets.LINGUIST_GH_PRIVATE_KEY }}
cnb_registry_token: ${{ secrets.CNB_REGISTRY_RELEASE_BOT_GITHUB_TOKEN }}
docker_hub_user: ${{ secrets.DOCKER_HUB_USER }}
docker_hub_token: ${{ secrets.DOCKER_HUB_TOKEN }}
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.idea
dist/
node_modules/
.tool-versions

packaged/
**/target/
*.cnb

.DS_Store
Loading

0 comments on commit e9b9efc

Please sign in to comment.