From 4bf456fcfe21f2a179e3c3e2061200d592db0c08 Mon Sep 17 00:00:00 2001 From: Gonzalo Diaz Date: Mon, 9 Dec 2024 12:29:30 -0300 Subject: [PATCH 1/4] [CONFIG] [Github Actions] Now use fixed version of Github Actions images. --- .github/workflows/c.yml | 2 +- .github/workflows/docker-image.yml | 10 +++++----- .github/workflows/gitleaks.yml | 2 +- .github/workflows/markdown-lint.yml | 2 +- .github/workflows/yamllint.yml | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/c.yml b/.github/workflows/c.yml index 28d0b6c..bf1903e 100644 --- a/.github/workflows/c.yml +++ b/.github/workflows/c.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-24.04 strategy: matrix: - os: ["windows-latest", "ubuntu-latest", "macOS-latest"] + os: ["windows-2022", "ubuntu-24.04", "macos-14"] steps: - name: Checkout repository diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 59f7337..da390f6 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -18,7 +18,7 @@ jobs: build: name: "Build Docker images" - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 @@ -73,7 +73,7 @@ jobs: lint: name: "Run in docker: LINT" - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 needs: build steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 @@ -98,7 +98,7 @@ jobs: test: name: "Run in docker: TEST" - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 needs: build steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 @@ -123,7 +123,7 @@ jobs: security: name: "Snyk Container" - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 needs: build permissions: actions: read @@ -170,7 +170,7 @@ jobs: sarif_file: 'snyk.sarif' scan: name: "Trivy" - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 needs: build permissions: actions: read diff --git a/.github/workflows/gitleaks.yml b/.github/workflows/gitleaks.yml index 4e087f9..cff8f02 100644 --- a/.github/workflows/gitleaks.yml +++ b/.github/workflows/gitleaks.yml @@ -20,7 +20,7 @@ on: # yamllint disable-line rule:truthy jobs: scan: name: gitleaks - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 with: diff --git a/.github/workflows/markdown-lint.yml b/.github/workflows/markdown-lint.yml index 2a73909..82d31b5 100644 --- a/.github/workflows/markdown-lint.yml +++ b/.github/workflows/markdown-lint.yml @@ -13,7 +13,7 @@ on: # yamllint disable-line rule:truthy jobs: lint: name: Markdown Lint - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Checkout repository diff --git a/.github/workflows/yamllint.yml b/.github/workflows/yamllint.yml index c8a8a5d..3c0fa11 100644 --- a/.github/workflows/yamllint.yml +++ b/.github/workflows/yamllint.yml @@ -13,7 +13,7 @@ on: # yamllint disable-line rule:truthy jobs: lint: name: YAML lint - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Checkout repository uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 From 18dba212b061936b46abf4ab5b437f8359f8cf1c Mon Sep 17 00:00:00 2001 From: Gonzalo Diaz Date: Mon, 9 Dec 2024 14:28:27 -0300 Subject: [PATCH 2/4] [CONFIG] [Github Actions] apt-update before install new packages. --- .github/workflows/c-coverage.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/c-coverage.yml b/.github/workflows/c-coverage.yml index 3b5f1f8..0a6c530 100644 --- a/.github/workflows/c-coverage.yml +++ b/.github/workflows/c-coverage.yml @@ -20,6 +20,7 @@ jobs: - name: Install Tools run: | + sudo apt update sudo apt-get install lcov - name: Check Tools From 0a6076775c890c9fd19286c627bb739d4a0c2361 Mon Sep 17 00:00:00 2001 From: Gonzalo Diaz Date: Mon, 9 Dec 2024 14:58:49 -0300 Subject: [PATCH 3/4] [CONFIG] [Docker] Base image set to current LTS specific version: Ubuntu 24.04 Noble. --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index e5a4104..6c1eadc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:24.10 AS init +FROM ubuntu:noble-20241118.1 AS init ENV WORKDIR=/app WORKDIR ${WORKDIR} @@ -15,7 +15,7 @@ ENV TZ=Etc/UTC # build tools RUN apt-get update \ - && apt-get -y install --no-install-recommends --no-install-suggests build-essential cmake gcc g++ make pkg-config \ + && apt-get -y install --no-install-recommends --no-install-suggests build-essential cmake g++ gcc make pkg-config \ && rm -rf /var/lib/apt/lists/* \ && make --version \ && cmake --version \ @@ -112,7 +112,7 @@ COPY --from=builder ${WORKDIR}/build ${WORKDIR}/ CMD ["make", "test"] -FROM ubuntu:24.10 AS production +FROM ubuntu:noble-20241118.1 AS production ENV LOG_LEVEL=INFO ENV BRUTEFORCE=false From 96c7ad8460c9470e069bd1e96591e29d178e6038 Mon Sep 17 00:00:00 2001 From: Gonzalo Diaz Date: Mon, 9 Dec 2024 15:17:03 -0300 Subject: [PATCH 4/4] [CONFIG] [make] Local Makefile commands to run in Docker fixed. --- Makefile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 1a466f6..4a260af 100644 --- a/Makefile +++ b/Makefile @@ -119,24 +119,24 @@ compose/rebuild: env compose/lint/markdown: compose/build ${DOCKER_COMPOSE} --profile lint build - ${DOCKER_COMPOSE} --profile lint run --rm algorithm-exercises-cpp-lint make lint/markdown + ${DOCKER_COMPOSE} --profile lint run --rm algorithm-exercises-c-lint make lint/markdown compose/lint/yaml: compose/build - ${DOCKER_COMPOSE} --profile lint run --rm algorithm-exercises-cpp-lint make lint/yaml + ${DOCKER_COMPOSE} --profile lint run --rm algorithm-exercises-c-lint make lint/yaml compose/test/styling: compose/build - ${DOCKER_COMPOSE} --profile lint run --rm algorithm-exercises-cpp-lint make test/styling + ${DOCKER_COMPOSE} --profile lint run --rm algorithm-exercises-c-lint make test/styling compose/test/static: compose/build - ${DOCKER_COMPOSE} --profile lint run --rm algorithm-exercises-cpp-lint make test/static + ${DOCKER_COMPOSE} --profile lint run --rm algorithm-exercises-c-lint make test/static compose/lint: compose/lint/markdown compose/lint/yaml compose/test/styling compose/test/static compose/test: compose/build - ${DOCKER_COMPOSE} --profile testing run --rm algorithm-exercises-cpp-test make test + ${DOCKER_COMPOSE} --profile testing run --rm algorithm-exercises-c-test make test compose/run: compose/build - ${DOCKER_COMPOSE} --profile production run --rm algorithm-exercises-cpp ls -alhR + ${DOCKER_COMPOSE} --profile production run --rm algorithm-exercises-c ls -alhR all: env dependencies test