Skip to content

Commit

Permalink
[NVSHAS-9630] Add release.yaml for scan-action slsa and update MakeFile
Browse files Browse the repository at this point in the history
[NVSHAS-9630] Fall back to origin build.yaml with remove redundant gha

[NVSHAS-9630] Update the way to setup Bats

[NVSHAS-9630] Add Hadolint to check dockerfile

[NVSHAS-9630] Add Hadolint to check dockerfile

[NVSHAS-9630] Update bat version

[NVSHAS-9630] Check out tag

[NVSHAS-9630] Add checksum check

[NVSHAS-9630] Improve bat setup
  • Loading branch information
pohanhuangtw committed Nov 12, 2024
1 parent ec7b6a1 commit 624d218
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 12 deletions.
32 changes: 23 additions & 9 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,33 +1,47 @@
name: "build"
on: [push, pull_request]

jobs:
build:
name: build
runs-on: ubuntu-latest
steps:
- name: Setup BATS
uses: mig4/setup-bats@v1
- name: Checkout BATS
uses: actions/checkout@v4
with:
bats-version: 1.7.0
repository: bats-core/bats-core
ref: v1.11.0

- name: Setup BATS
run: |
sudo ./install.sh /usr/local
- name: Check out code
uses: actions/checkout@v4

- name: Lint Dockerfile
uses: hadolint/hadolint-action@v3.1.0
- name: Run tests
run: bats test

- uses: actions/setup-node@v4
with:
node-version: 18

- run: npm ci

- name: Install Hadolint
run: |
wget -O hadolint https://github.com/hadolint/hadolint/releases/download/v2.12.0/hadolint-Linux-x86_64
echo "56de6d5e5ec427e17b74fa48d51271c7fc0d61244bf5c90e828aab8362d55010 hadolint" | sha256sum --check
sudo mv hadolint /usr/local/bin/hadolint
sudo chmod +x /usr/local/bin/hadolint
- name: Run Hadolint
run: |
hadolint Dockerfile
- name: Check if README is up-to-date
run: |
npm run docs
git status
git diff --quiet || echo 'README is not up-to-date, run `npm install && npm run docs` to update.'
git diff --quiet || exit 1
- name: Run tests
run: bats test
git diff --quiet || exit 1
3 changes: 0 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
.PHONY: test lint

lint:
hadolint Dockerfile

test:
bats test

Expand Down

0 comments on commit 624d218

Please sign in to comment.