Skip to content

Commit

Permalink
Add pre-commit config and fix lints
Browse files Browse the repository at this point in the history
  • Loading branch information
jdmarble committed Jan 14, 2024
1 parent 284624c commit 32cedbf
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 14 deletions.
4 changes: 3 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
version: 2
updates:
- package-ecosystem: "github-actions"
# Workflow files stored in the default location of `.github/workflows`. (You don't need to specify `/.github/workflows` for `directory`. You can use `directory: "/"`.)
# Workflow files stored in the default location of `.github/workflows`.
# (You don't need to specify `/.github/workflows` for `directory`.
# You can use `directory: "/"`.)
directory: "/"
schedule:
interval: "weekly"
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/container-image.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Container image
on:
"on":
push:
branches:
- 'main'
Expand All @@ -12,18 +12,19 @@ env:
jobs:
build-and-push-image:
runs-on: ubuntu-latest

permissions:
contents: read
packages: write

steps:
# To add emulation support with QEMU to be able to build against more platforms.
# To add emulation support to be able to build against more platforms.
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

# Will create and boot a builder using by default the docker-container driver.
# This is not required but recommended to be able to build multi-platform images, export cache, etc.

# Will create a builder using by default the docker-container driver.
# Not required but recommended to be able to build multi-platform
# images, export cache, etc.
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

Expand Down
24 changes: 24 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: check-shebang-scripts-are-executable
- id: check-symlinks
- id: detect-private-key
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.32.0
hooks:
- id: yamllint
args: ["--strict"]
- repo: https://github.com/hadolint/hadolint
rev: v2.12.0
hooks:
- id: hadolint-docker
20 changes: 13 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
FROM docker.io/library/debian:12.4-slim as builder

RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y build-essential git sudo
RUN DEBIAN_FRONTEND=noninteractive apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential=12.9 \
ca-certificates=20230311 \
git=1:2.39.2-1.1 \
sudo=1.9.13p3-1+deb12u1
# Not removing cache here because the deps.sh script can use it.
# The cache will not be in the final stage of the image anyway.

RUN mkdir /simh \
&& git clone --depth 1 https://github.com/open-simh/simh.git /simh
&& git clone --depth 1 https://github.com/open-simh/simh.git /simh \
&& /simh/.travis/deps.sh linux \
&& /simh/cmake/cmake-builder.sh --novideo --noinstall --parallel --target pdp11

RUN /simh/.travis/deps.sh linux

RUN /simh/cmake/cmake-builder.sh --novideo --noinstall --parallel --target pdp11

FROM gcr.io/distroless/base-debian12
# FROM gcr.io/distroless/base-debian12:nonroot
FROM gcr.io/distroless/base-debian12@sha256:684dee415923cb150793530f7997c96b3cef006c868738a2728597773cf27359

COPY --from=builder /usr/lib/x86_64-linux-gnu/libvdeplug.so.2 /usr/lib/x86_64-linux-gnu/libvdeplug.so.2
COPY --from=builder /lib/x86_64-linux-gnu/libpcre.so.3 /lib/x86_64-linux-gnu/libpcre.so.3
Expand Down

0 comments on commit 32cedbf

Please sign in to comment.