Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update to 1.17.0 plus big refactor #4

Merged
merged 4 commits into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": [
"@commitlint/config-conventional"
]
}
15 changes: 15 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM jetpackio/devbox:latest

# Installing your devbox project
WORKDIR /code
USER root:root
RUN mkdir -p /code && chown ${DEVBOX_USER}:${DEVBOX_USER} /code
USER ${DEVBOX_USER}:${DEVBOX_USER}
COPY --chown=${DEVBOX_USER}:${DEVBOX_USER} devbox.json devbox.json
COPY --chown=${DEVBOX_USER}:${DEVBOX_USER} devbox.lock devbox.lock



RUN devbox run -- echo "Installed Packages."

RUN devbox shellenv --init-hook >> ~/.profile
14 changes: 14 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "Devbox Remote Container",
"build": {
"dockerfile": "./Dockerfile",
"context": ".."
},
"customizations": {
"vscode": {
"settings": {},
"extensions": ["jetpack-io.devbox", "task.vscode-task"]
}
},
"remoteUser": "devbox"
}
14 changes: 14 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.github
.devcontainer
.vscode
.lefthook
.commitlintrc.json
.editorconfig
.envrc
.env
.hadolint.yaml
CONTRIBUTING.md
Dockerfile
lefthook.yaml
structure-tests.yaml
Taskfile.yml
8 changes: 2 additions & 6 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,14 @@ charset = utf-8
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 80
max_line_length = 120

[*.md]
indent_style = space
indent_size = 4
trim_trailing_whitespace = false

[Makefile]
indent_style = tab
indent_size = 4

[{Dockerfile,Dockerfile.template.erb,Dockerfile.sample}]
[Dockerfile]
indent_style = space
indent_size = 4

Expand Down
7 changes: 7 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Automatically sets up your devbox environment whenever you cd into this
# directory via our direnv integration:

eval "$(devbox generate direnv --print-envrc)"

# check out https://www.jetpack.io/devbox/docs/ide_configuration/direnv/
# for more details
4 changes: 4 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# This is a CODEOWNERS file.
# Each line is a file pattern followed by one or more owners.

* @brpaz
21 changes: 21 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: 2
updates:
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "weekly"
reviewers:
- "brpaz"
open-pull-requests-limit: 5
labels:
- "dependencies"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
reviewers:
- "brpaz"
open-pull-requests-limit: 3
labels:
- "dependencies"
21 changes: 21 additions & 0 deletions .github/labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
- name: bug
description: Something isn't working
color: d73a4a
- name: documentation
description: Improvements or additions to documentation
color: 0075ca
- name: duplicate
description: This issue or pull request already exists
color: cfd3d7
- name: security
description: Security updates
color: a31f34
- name: feature
description: New feature
color: 0e8a16
- name: enhancement
description: Enhancement on existing Feature
color: 0e8a16
- name: chore
description: Maintenance
color: F6EE8F
56 changes: 56 additions & 0 deletions .github/release-drafter-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name-template: "$RESOLVED_VERSION"
tag-template: "$RESOLVED_VERSION"
categories:
- title: "Breaking Changes"
labels:
- breaking
- title: 🚀 Features
labels:
- feature
- enhancement
- title: 🐛 Bug Fixes
labels:
- bug
- title: 🔐 Security updates
labels:
- security
- title: ⚠️ Maintenance
labels:
- chore
- maintenance
- title: 📄 Documentation
labels:
- docs
- documentation
- title: 🧩 Dependency Updates
labels:
- deps
- dependencies
collapse-after: 5
change-template: "- $TITLE @$AUTHOR (#$NUMBER)"
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
exclude-labels:
- "skip-changelog"
version-resolver:
major:
labels:
- "breaking"
minor:
labels:
- feature
- enhancement
patch:
labels:
- "bug"
- "maintenance"
- "chore"
- "dependencies"
- "deps"
- "security"
- "docs"
template: |
# What's Changed

$CHANGES

**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION
80 changes: 34 additions & 46 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,65 +4,53 @@ on:
branches:
- master
pull_request:
release:
types: [published]

env:
TEST_IMAGE_NAME: structure-tests-action:${{github.sha}}
TEST_IMAGE_TAG: structure-tests-action:test

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: brpaz/hadolint-action@master
build:
runs-on: ubuntu-latest
needs: ['lint']
steps:
- uses: actions/checkout@v1
- name: Build Docker image
run: docker build -t $TEST_IMAGE_NAME .

- name: Save Docker image artifact
run: docker save -o action.tar $TEST_IMAGE_NAME
- uses: actions/checkout@v4

- name: Upload image artifact
uses: actions/upload-artifact@master
- name: Lint Dockerfile
uses: hadolint/[email protected]
with:
name: action-image
path: action.tar
dockerfile: Dockerfile

test:
name: Unit Tests
build:
name: Build and Test
runs-on: ubuntu-latest
needs: build
needs: [lint]
steps:
- uses: actions/checkout@v1
- name: Pull Image artifact
uses: actions/download-artifact@master
with:
name: action-image
- name: Checkout
uses: actions/checkout@v4

- name: Load image into docker context
run: docker load -i action-image/action.tar
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Get Image name
id: image_name
run: echo "##[set-output name=image;]$(echo $TEST_IMAGE_NAME)"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Run Structure tests
uses: ./
- name: Build test image
uses: docker/build-push-action@v5
with:
configFile: 'structure-tests.yaml'
image: ${{steps.image_name.outputs.image}}

release:
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
name: Release
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v1
- name: Semantic Release
uses: brpaz/action-semantic-release@v1
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
context: .
load: true
tags: ${{ env.TEST_IMAGE_TAG }}

- name: Install container-structure-test
run: |
curl -LO https://github.com/GoogleContainerTools/container-structure-test/releases/download/v1.17.0/container-structure-test-linux-amd64 \
&& chmod +x container-structure-test-linux-amd64 \
&& mv container-structure-test-linux-amd64 /usr/local/bin/container-structure-test \
&& container-structure-test version

- name: Run tests
run: |
container-structure-test test \
--image ${{ env.TEST_IMAGE_TAG }} \
--config structure-tests.yaml
29 changes: 29 additions & 0 deletions .github/workflows/label-checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Label Checker

on:
pull_request:
types:
- opened
- synchronize
- reopened
- labeled
- unlabeled

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true

permissions:
contents: read
pull-requests: read
checks: write

jobs:
check_cc_labels:
name: Check conventional commits labels
runs-on: "ubuntu-latest"
steps:
- uses: danielchabr/[email protected]
with:
hasSome: feature,fix,changed,deprecated,security,docs,dependencies
githubToken: ${{ secrets.GITHUB_TOKEN }}
27 changes: 27 additions & 0 deletions .github/workflows/pr-title-checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Check PR title

on:
pull_request:
types:
- opened
- reopened
- edited
- synchronize

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true

permissions:
contents: read
statuses: write

jobs:
title-checker:
name: Check PR title
runs-on: ubuntu-latest

steps:
- uses: aslafy-z/conventional-pr-title-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27 changes: 27 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Release Drafter

on:
push:
# branches to consider in the event; optional, defaults to all
branches:
- main
# pull_request event is required only for autolabeler
pull_request:
# Only following types are handled by the action, but one can default to all as well
types: [opened, reopened, synchronize]

jobs:
update_release_draft:
permissions:
# write permission is required to create a github release
contents: write
# write permission is required for autolabeler
# otherwise, read permission is required at least
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v6
with:
config-name: release-drafter-config.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21 changes: 21 additions & 0 deletions .github/workflows/sync-labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Sync labels
on:
push:
branches:
- main
paths:
- .github/labels.yml
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: micnncim/action-label-syncer@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
manifest: .github/labels.yml
Loading
Loading