From 318cdf90aa433a45b52892703ec90196a8245e40 Mon Sep 17 00:00:00 2001 From: mtweeman Date: Mon, 9 Sep 2024 20:54:26 +0200 Subject: [PATCH] ci: Experiment with geodesic workflow --- .github/workflows/static-analysis.yaml | 6 +-- ...ic-analyzers-aggregator-geodesic-test.yaml | 49 +++++++++++++++++++ ...tatic-analyzers-aggregator-pre-commit.yaml | 23 --------- Dockerfile | 4 ++ 4 files changed, 56 insertions(+), 26 deletions(-) create mode 100644 .github/workflows/static-analyzers-aggregator-geodesic-test.yaml delete mode 100644 .github/workflows/static-analyzers-aggregator-pre-commit.yaml diff --git a/.github/workflows/static-analysis.yaml b/.github/workflows/static-analysis.yaml index 3e45fcbf..dafdc854 100644 --- a/.github/workflows/static-analysis.yaml +++ b/.github/workflows/static-analysis.yaml @@ -53,8 +53,8 @@ jobs: terraform-version: ${{ needs.preparation.outputs.terraform-version }} severity: ${{ needs.preparation.outputs.severity }} - static-analysis-pre-commit-test: + static-analysis-geodesic-test: needs: - preparation - name: Static analysis pre-commit - uses: ./.github/workflows/static-analyzers-aggregator-pre-commit.yaml + name: Static analysis geodesic test + uses: ./.github/workflows/static-analyzers-aggregator-geodesic-test.yaml diff --git a/.github/workflows/static-analyzers-aggregator-geodesic-test.yaml b/.github/workflows/static-analyzers-aggregator-geodesic-test.yaml new file mode 100644 index 00000000..f825ab26 --- /dev/null +++ b/.github/workflows/static-analyzers-aggregator-geodesic-test.yaml @@ -0,0 +1,49 @@ +name: Static analyzers aggregator geodesic test + +on: + workflow_call: + +permissions: + contents: read + +jobs: + static-analysis-geodesic-test: + name: Static analysis geodesic test + runs-on: ubuntu-latest + container: + image: mtweeman/hajle-silesia_provisioning-ld:latest + options: --rm -it + + defaults: + run: + shell: + bash -l -e -o pipefail {0} # removed --noprofile, --norc options from default bash + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Commands + run: | + echo "PATH: ${PATH}" + for path in $(mise bin-paths); do + export PATH="${path}:${PATH}" + done + echo "MISE: $(mise --version)" + echo "terraform: $(terraform --version)" + echo "TFLint: $(tflint --version)" + echo "TRivy: $(trivy --version)" + echo "pc: $(pre-commit --version)" + pre-commit install + pre-commit run --all --hook-stage manual +# - run: | +# docker run --rm mtweeman/hajle-silesia_provisioning-ld:latest init | bash +# /usr/local/bin/hajle-silesia_provisioning-ld +# cd / +# echo "DYSK: $(ls -la)" +# . conf/.profile +# echo "MISE: $(mise --version)" +# echo "PATH: ${PATH}" +# echo "TRivy: $(trivy --version)" +# echo "TFLint: $(tflint --version)" +# pre-commit install +# pre-commit run --all --hook-stage manual diff --git a/.github/workflows/static-analyzers-aggregator-pre-commit.yaml b/.github/workflows/static-analyzers-aggregator-pre-commit.yaml deleted file mode 100644 index b09c3460..00000000 --- a/.github/workflows/static-analyzers-aggregator-pre-commit.yaml +++ /dev/null @@ -1,23 +0,0 @@ -name: Static analyzers aggregator pre-commit - -on: - workflow_call: - -permissions: - contents: read - -jobs: - static-analysis-pre-commit: - name: Static analysis pre-commit - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - name: Restore cached static analyzers - uses: actions/cache/restore@v4 - with: - path: . - key: static-analyzers-pre-commit - - name: Static analysis - run: | - pre-commit run --all-files diff --git a/Dockerfile b/Dockerfile index baf105d7..daae1a27 100755 --- a/Dockerfile +++ b/Dockerfile @@ -24,3 +24,7 @@ RUN echo "eval \"\$(${MISE_INSTALL_PATH} activate bash)\"" >> ~/.profile COPY .mise.toml /etc/mise/config.toml # source: https://mise.jdx.dev/cli/install.html RUN mise install --yes +SHELL ["/bin/bash", "-c"] +RUN . /conf/.profile && echo "${PATH}" +RUN eval "$(${MISE_INSTALL_PATH} activate bash)" && echo "${PATH}" +ENV PATH="${PATH}"