Skip to content

Commit

Permalink
ci: add lint and deploy workflows (#3)
Browse files Browse the repository at this point in the history
* ci: lint and deploy workflows

* chore: kurtosis lint --format

* chore: add tools config

* fix: shellcheck issues

* chore: more clean up

* Revert "chore: more clean up"

This reverts commit 11e897e.

* chore: disable SC2016 when using tomlq slurpfile
  • Loading branch information
leovct authored Mar 14, 2024
1 parent 3dcd4e0 commit 37b3741
Show file tree
Hide file tree
Showing 6 changed files with 410 additions and 242 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: deploy

on:
pull_request:
push:
branches: [main]

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

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Deploy devnet
uses: kurtosis-tech/kurtosis-github-action@v1
with:
path: .
args: cdk-params.yml
54 changes: 54 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
name: lint

on:
pull_request:
push:
branches: [main]

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

jobs:
starklark:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install kurtosis
run: |
echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list
sudo apt update
sudo apt install kurtosis-cli
kurtosis analytics disable
- name: Run kurtosis linter
run: kurtosis lint ${{ github.workspace }}

yaml:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install yamllint
run: pip install yamllint
- name: Run yamllint
run: yamllint --config-file .yamllint.yml .

hadolint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install hadolint
run: |
sudo wget -O /usr/local/bin/hadolint https://github.com/hadolint/hadolint/releases/latest/download/hadolint-Linux-x86_64
sudo chmod +x /usr/local/bin/hadolint
- name: Run hadolint
run: find . -type f -name 'Dockerfile*' | sort | xargs -I {} hadolint --config .hadolint.yml {}

shellcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install shellcheck
run: sudo apt install shellcheck
- name: Run shellcheck
run: find . -type f -name '*.sh' | sort | xargs -I {} shellcheck {}
5 changes: 5 additions & 0 deletions .hadolint
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
strict-labels: true # Do not permit labels other than specified in `label-schema`.
label-schema:
author: email
description: text
3 changes: 3 additions & 0 deletions .yamllint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
rules:
line-length: disable
Loading

0 comments on commit 37b3741

Please sign in to comment.