Skip to content

Commit e0f225c

Browse files
committed
odin-266: ruff upgrade and public repo changes
1 parent ae5eb2f commit e0f225c

File tree

15 files changed

+876
-136
lines changed

15 files changed

+876
-136
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: "common-build-steps"
2+
description: "regular build steps"
3+
4+
5+
runs:
6+
using: "composite"
7+
steps:
8+
9+
- name: setup python
10+
uses: actions/setup-python@v5
11+
with:
12+
python-version: 3.12
13+
14+
- name: print branch info
15+
shell: bash
16+
run: |
17+
git branch
18+
echo "GITHUB_HEAD_REF=${GITHUB_HEAD_REF}"
19+
echo "GITHUB_BASE_REF=${GITHUB_BASE_REF}"
20+
git log --oneline -n 10
21+
22+
- name: clean
23+
shell: bash
24+
run: |
25+
git clean -fdx
26+
27+
- name: check secrets
28+
uses: ./.github/actions/check-secrets
29+
30+
- name: merge into base_branch
31+
if: ${{ github.event_name == 'pull_request' }}
32+
shell: bash
33+
run: |
34+
echo base branch "${{ github.base_ref }}"
35+
echo pr branch "${{ github.head_ref }}"
36+
git checkout "${{ github.base_ref }}"
37+
git checkout -b "merging-${{ github.event.number }}"
38+
git merge --ff-only "${{ github.event.pull_request.head.sha }}"
39+
40+
- name: git reset
41+
shell: bash
42+
run: git reset --hard
43+
44+
45+
- name: replace remove some unneeded tools
46+
if: ${{ hashFiles('**/.tool-versions') }}
47+
shell: bash
48+
run: |
49+
sed -i -E 's#^python .*##g' .tool-versions
50+
sed -i -E 's#^pre-commit .*##g' .tool-versions
51+
52+
- name: Install tools from asdf config
53+
if: ${{ hashFiles('**/.tool-versions') }}
54+
uses: ai/asdf-cache-action@v1
55+
56+
- name: cache virtualenv
57+
uses: actions/cache@v4
58+
with:
59+
path: |
60+
.venv
61+
**/.lock-hash
62+
**/requirements.txt
63+
key: ${{ runner.os }}-py-${{ inputs.python-version }}-poetry-${{ hashFiles('./poetry.lock') }}
64+
65+
- name: install
66+
shell: bash
67+
run: make install-ci
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: "CI stages"
2+
description: "run any standard CI stages found in the root Makefile"
3+
4+
inputs:
5+
scan-type:
6+
description: secrets scan type recursive/untracked etc.
7+
default: 'recursive'
8+
required: false
9+
10+
runs:
11+
using: "composite"
12+
steps:
13+
- name: run git-secrets
14+
shell: bash
15+
run: |
16+
export PATH="${PATH}:${{ github.action_path }}"
17+
git secrets --register-aws
18+
if [[ -e ./.gitdisallowed ]]; then
19+
git secrets --add-provider -- grep -Ev '^(#.*|\s*$)' .gitdisallowed || true
20+
git secrets --add --allowed '^.gitdisallowed:[0-9]+:.*' || true
21+
fi
22+
git secrets --scan --${{ inputs.scan-type }}

0 commit comments

Comments
 (0)