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

add workflows for hadolint and mdbook #120

Merged
merged 1 commit into from
Jun 4, 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
33 changes: 26 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,21 @@ on:
push:
branches:
- main
paths-ignore:
- "**.md"
paths:
- "!**.md"
- ".github/workflows/ci.yml"
- "deps/Cargo.*"
- ".dockerignore"
- "Dockerfile"
- "Makefile"
pull_request:
paths-ignore:
- "**.md"
paths:
- "!**.md"
- ".github/workflows/ci.yml"
- "deps/Cargo.*"
- ".dockerignore"
- "Dockerfile"
- "Makefile"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || github.run_id }}
Expand All @@ -19,9 +29,6 @@ env:
IS_PULL_REQUEST: ${{ github.event_name == 'pull_request' }}

jobs:
hadolint:
uses: peaceiris/workflows/.github/workflows/hadolint.yml@v0.20.1

docker:
runs-on: namespace-profile-ubuntu2204-${{ matrix.arch }}-8x16-with-cache
timeout-minutes: 6
Expand Down Expand Up @@ -63,3 +70,15 @@ jobs:
DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN }}

- run: make merge

test:
if: ${{ github.event_name != 'pull_request' }}
needs: merge
runs-on: ubuntu-22.04
timeout-minutes: 1
permissions:
contents: read
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6

- run: make test-build-with-latest
21 changes: 21 additions & 0 deletions .github/workflows/hadolint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: hadolint

on:
push:
branches:
- main
paths:
- "Dockerfile"
- ".hadolint.yaml"
pull_request:
paths:
- "Dockerfile"
- ".hadolint.yaml"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
lint:
uses: peaceiris/workflows/.github/workflows/hadolint.yml@v0.20.1
35 changes: 35 additions & 0 deletions .github/workflows/mdbook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: mdbook

on:
push:
branches:
- main
paths:
- ".github/workflows/mdbook.yml"
- "examples/**"
- "Makefile"
pull_request:
paths:
- ".github/workflows/mdbook.yml"
- "examples/**"
- "Makefile"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-22.04
timeout-minutes: 1
permissions:
contents: read
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6

- run: make login
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN }}

- run: make test-build-with-latest
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ test-build:
docker run --rm -v "./example:/book" "${HUB_NAME}-$(PLATFORM)" build
docker run --rm -v "./example:/book" --entrypoint sh "${HUB_NAME}-$(PLATFORM)" -c 'mdbook-admonish install /book'

.PHONY: test-build-with-latest
test-build-with-latest:
docker run --rm -v "./example:/book" "${HUB_LATEST}" build
docker run --rm -v "./example:/book" --entrypoint sh "${HUB_LATEST}" -c 'mdbook-admonish install /book'

.PHONY: run
run:
docker run --rm -i -t -v "./example:/book" -p "3000:3000" -p "3001:3001" --entrypoint sh "${HUB_NAME}-$(PLATFORM)"
Loading