From 624d2187d678a49aaab593ec4e981cd8101aa219 Mon Sep 17 00:00:00 2001 From: pohanhuangtw Date: Tue, 12 Nov 2024 01:43:48 +0800 Subject: [PATCH] [NVSHAS-9630] Add release.yaml for scan-action slsa and update MakeFile [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 --- .github/workflows/build.yaml | 32 +++++++++++++++++++++++--------- Makefile | 3 --- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 71d2dc2..0c79288 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -1,20 +1,26 @@ 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: @@ -22,12 +28,20 @@ jobs: - 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 \ No newline at end of file + git diff --quiet || exit 1 \ No newline at end of file diff --git a/Makefile b/Makefile index 7e7fb87..a9a8454 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,5 @@ .PHONY: test lint -lint: - hadolint Dockerfile - test: bats test