diff --git a/.github/actions/build-common/action.yml b/.github/actions/build-common/action.yml index f61b59f..9965edf 100644 --- a/.github/actions/build-common/action.yml +++ b/.github/actions/build-common/action.yml @@ -52,9 +52,9 @@ runs: sed -i -E 's#^python .*##g' .tool-versions sed -i -E 's#^pre-commit .*##g' .tool-versions - - name: Install tools from asdf config + - name: Install tools from mise config if: ${{ hashFiles('**/.tool-versions') }} - uses: ai/asdf-cache-action@d74eacf1ff3bb69ce232d6147c88704a9668db3a + uses: ./.github/actions/mise-cache - name: cache virtualenv uses: actions/cache@v4 diff --git a/.github/actions/mise-cache/action.yml b/.github/actions/mise-cache/action.yml new file mode 100644 index 0000000..8674b36 --- /dev/null +++ b/.github/actions/mise-cache/action.yml @@ -0,0 +1,17 @@ +name: "mise-cache" +description: "mise cache action, wrapper for mise-action" +inputs: + mise-version: + description: "mise version to install" + default: "" + required: false +runs: + using: "composite" + steps: + + - name: Install tools using mise and cache them + if: ${{ hashFiles('**/.tool-versions') }} + uses: jdx/mise-action@d53861813ec96de6a7b18548a2c75ba8f6055fbf + with: + version: ${{ inputs.mise-version }} + cache_key: "odin-mise-{{platform}}-{{version}}-{{file_hash}}" # Override the entire cache key diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 7ef90b9..1b2b604 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -5,6 +5,10 @@ on: branches: - develop +concurrency: + group: ${{ github.event.pull_request.number }} + cancel-in-progress: true + jobs: lint: diff --git a/.tool-versions b/.tool-versions index 5a4aacd..7de6e73 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,6 +1,6 @@ pre-commit 4.2.0 python 3.12.10 -poetry 1.8.5 -terraform 1.12.2 -trivy 0.69.2 -tflint 0.61.0 +poetry 2.2.1 +terraform 1.15.8 +trivy 0.71.2 +tflint 0.63.1 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 474eda0..b9fe384 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,16 +4,15 @@ tools used: - make - git -- [asdf version manager](https://asdf-vm.com/guide/getting-started.html) +- mise ## first run ... ### install project tools -use asdf to ensure required tools are installed ... configured tools are in [.tool-versions](.tool-versions) +use mise to ensure required tools are installed ... configured tools are in [.tool-versions](.tool-versions) ```bash cd ~/work/terraform-aws-metrics-lambda -for plugin in $(grep -E '^\w+' .tool-versions | cut -d' ' -f1); do asdf plugin add $plugin; done -asdf install +mise install ``` ### setup git-secrets diff --git a/Makefile b/Makefile index c91e4bc..a088360 100644 --- a/Makefile +++ b/Makefile @@ -108,3 +108,10 @@ check-secrets-all: check-secrets-history: scripts/check-secrets.sh history + +clean: + rm -rf ./dist + +dist: clean + rsync -av ./ --exclude .git --exclude .venv --exclude .idea --exclude .github --exclude .pytest_cache --exclude .ruff_cache --exclude __pycache__ --exclude .mypy_cache --exclude dist --exclude reports --exclude tests --exclude scripts --exclude Makefile --exclude sonar-project.properties --exclude '.*' --exclude '*.md' --exclude '*.yaml' --exclude '*.toml' ./ ./dist + pushd ./dist && zip -r ../dist.zip . && popd