Skip to content

Commit

Permalink
Migrate from Circle CI to GitHub Actions
Browse files Browse the repository at this point in the history
Since we need to migrate all of our repos to GitHub Actions.

This is based on the config used by our other Rust CNBs.

See:
https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions

The check changelog check was also made consistent with that
used in other Rust repositories (dependencies aren't test-only,
so may sometimes need a changelog entry etc).
  • Loading branch information
edmorley authored and schneems committed Jan 31, 2023
1 parent f47e8f3 commit dd7a15b
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 78 deletions.
72 changes: 0 additions & 72 deletions .circleci/config.yml

This file was deleted.

11 changes: 7 additions & 4 deletions .github/workflows/check_changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,20 @@ on:
pull_request:
types: [opened, reopened, edited, labeled, unlabeled, synchronize]

permissions:
contents: read

jobs:
check-changelog:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
if: |
!contains(github.event.pull_request.body, '[skip changelog]') &&
!contains(github.event.pull_request.body, '[changelog skip]') &&
!contains(github.event.pull_request.body, '[skip ci]') &&
!contains(github.event.pull_request.labels.*.name, 'skip changelog') &&
!contains(github.event.pull_request.labels.*.name, 'dependencies')
!contains(github.event.pull_request.labels.*.name, 'skip changelog')
steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3
- name: Check that CHANGELOG is touched
run: |
git fetch origin ${{ github.base_ref }} --depth 1 && \
Expand Down
60 changes: 60 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
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
3 changes: 1 addition & 2 deletions src/layers/ruby_version_install_layer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,7 @@ impl Layer for RubyVersionInstallLayer {
util::download(url.as_ref(), tmp_ruby_tgz.path())
.map_err(RubyBuildpackError::RubyDownloadError)?;

util::untar(tmp_ruby_tgz.path(), layer_path)
.map_err(RubyBuildpackError::RubyUntarError)?;
util::untar(tmp_ruby_tgz.path(), layer_path).map_err(RubyBuildpackError::RubyUntarError)?;

LayerResultBuilder::new(RubyMetadata {
version: self.version_string(),
Expand Down

0 comments on commit dd7a15b

Please sign in to comment.