Skip to content

Commit

Permalink
setup ci
Browse files Browse the repository at this point in the history
  • Loading branch information
cpanato committed Nov 7, 2023
1 parent b296bf8 commit 0d06991
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/actionlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright 2023 Chainguard, Inc.
# SPDX-License-Identifier: Apache-2.0

name: ActionLint

on:
pull_request:
branches:
- 'main'

jobs:

action-lint:
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0

- id: get_yamls
run: |

Check failure on line 21 in .github/workflows/actionlint.yaml

View workflow job for this annotation

GitHub Actions / actionlint

[actionlint] .github/workflows/actionlint.yaml#L21

shellcheck reported issue in this script: SC2027:warning:2:14: The surrounding quotes actually unquote this. Remove or escape them [shellcheck]
Raw output
.github/workflows/actionlint.yaml:21:9: shellcheck reported issue in this script: SC2027:warning:2:14: The surrounding quotes actually unquote this. Remove or escape them [shellcheck]

Check failure on line 21 in .github/workflows/actionlint.yaml

View workflow job for this annotation

GitHub Actions / actionlint

[actionlint] .github/workflows/actionlint.yaml#L21

shellcheck reported issue in this script: SC2086:info:2:14: Double quote to prevent globbing and word splitting [shellcheck]
Raw output
.github/workflows/actionlint.yaml:21:9: shellcheck reported issue in this script: SC2086:info:2:14: Double quote to prevent globbing and word splitting [shellcheck]

Check failure on line 21 in .github/workflows/actionlint.yaml

View workflow job for this annotation

GitHub Actions / actionlint

[actionlint] .github/workflows/actionlint.yaml#L21

shellcheck reported issue in this script: SC2086:info:2:28: Double quote to prevent globbing and word splitting [shellcheck]
Raw output
.github/workflows/actionlint.yaml:21:9: shellcheck reported issue in this script: SC2086:info:2:28: Double quote to prevent globbing and word splitting [shellcheck]
yamls=$(find . -name "*.yaml" -iname '.chainguard/source.yaml')
echo "files="${yamls}"" >> $GITHUB_OUTPUT
- uses: reviewdog/action-actionlint@v1
with:
actionlint_flags: ${{ steps.get_yamls.outputs.files }}
33 changes: 33 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright 2023 Chainguard, Inc.
# SPDX-License-Identifier: Apache-2.0

name: Test

on:
pull_request:
branches:
- 'main'

jobs:

test:
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0

- name: Run Digestabot
uses: ./
with:
create-pr: false

- name: Check changes
run: |
if [[ $(git diff --stat) == '' ]]; then
echo 'should exist changes'
exit 1
else
exit 0
fi
shell: bash
4 changes: 4 additions & 0 deletions testdata/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright 2023 Chainguard, Inc.
# SPDX-License-Identifier: Apache-2.0

FROM cgr.dev/chainguard/static@sha256:a8aeacbaf0a1176ab5dbcf9b73a517665d8db5e1495ba97d64c73b3821deb0d8
19 changes: 19 additions & 0 deletions testdata/k8s-job.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2023 Chainguard, Inc.
# SPDX-License-Identifier: Apache-2.0

apiVersion: batch/v1
kind: Job
metadata:
namespace: test
name: test
spec:
backoffLimit: 25
template:
metadata:
annotations:
spec:
restartPolicy: Never
- name: cosign
image: cgr.dev/chainguard/static@sha256:a8aeacbaf0a1176ab5dbcf9b73a517665d8db5e1495ba97d64c73b3821deb0d8
command: ["/bin/sh", "-c"]

0 comments on commit 0d06991

Please sign in to comment.