-
Notifications
You must be signed in to change notification settings - Fork 71
Expand file tree
/
Copy pathaction.yml
More file actions
87 lines (87 loc) · 3.42 KB
/
action.yml
File metadata and controls
87 lines (87 loc) · 3.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Setup Toltec dependencies
runs:
using: "composite"
steps:
- name: Check for Apt updates
shell: bash
run: |
sudo apt-get update -yq
echo "aptVersion=libarchive-tools-$(apt-cache policy libarchive-tools | grep -oP '(?<=Candidate:\s)(.+)')" >> $GITHUB_ENV
- name: Cache Apt packages
uses: actions/cache@v4
id: cache-apt
with:
path: ~/.aptcache
key: ${{ env.aptVersion }}
- name: Install or restore Apt packages
shell: bash
env:
CACHE_HIT: ${{ steps.cache-apt.outputs.cache-hit }}
run: |
if [[ "$CACHE_HIT" != 'true' ]]; then
sudo apt-get install -yq libarchive-tools
mkdir -p ~/.aptcache
sudo dpkg -L libarchive-tools | while IFS= read -r f; do if test -f $f; then echo $f; fi; done | xargs cp --parents --target-directory ~/.aptcache/
else
sudo cp --verbose --force --recursive ~/.aptcache/* /
fi
- name: Cache shfmt
uses: actions/cache@v4
with:
path: /usr/local/bin/shfmt
key: 43439b996942b53dfafa9b6ff084f394555d049c98fb7ec37978f7668b43e1be
- name: Install shfmt
shell: bash
run: |
install_dir=/usr/local/bin
if ! [[ -f "$install_dir"/shfmt ]]; then
shfmt_version=v3.2.1
shfmt_checksum=43439b996942b53dfafa9b6ff084f394555d049c98fb7ec37978f7668b43e1be
sudo curl --location --silent --fail --tlsv1.2 --proto '=https' \
--output "$install_dir"/shfmt \
https://github.com/mvdan/sh/releases/download/"$shfmt_version"/shfmt_"$shfmt_version"_linux_amd64
sha256sum -c <(echo "$shfmt_checksum $install_dir/shfmt") > /dev/null 2>&1
sudo chmod a+x "$install_dir"/shfmt
fi
- name: Cache Shellcheck
uses: actions/cache@v4
with:
path: /usr/local/bin/shellcheck
key: 64f17152d96d7ec261ad3086ed42d18232fcb65148b44571b564d688269d36c8
- name: Install Shellcheck
shell: bash
run: |
install_dir=/usr/local/bin
if ! [[ -f "$install_dir"/shellcheck ]];then
shellcheck_version=v0.7.1
shellcheck_checksum=64f17152d96d7ec261ad3086ed42d18232fcb65148b44571b564d688269d36c8
shellcheck_arname=shellcheck.tar.xz
curl --location --silent --fail --tlsv1.2 --proto '=https' \
--output "$shellcheck_arname" \
https://github.com/koalaman/shellcheck/releases/download/"$shellcheck_version"/shellcheck-"$shellcheck_version".linux.x86_64.tar.xz
sha256sum -c <(echo "$shellcheck_checksum $shellcheck_arname") > /dev/null 2>&1
tar -xf "$shellcheck_arname" --strip-components=1 \
shellcheck-"$shellcheck_version"/shellcheck
rm "$shellcheck_arname"
chmod a+x shellcheck
sudo chown root:root shellcheck
sudo mv shellcheck "$install_dir"
fi
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Cache Python environment
uses: actions/cache@v4
id: cache-python
with:
path: .venv
key: .venv-${{ hashFiles('requirements.txt') }}
- name: Install Python dependencies
shell: bash
env:
CACHE_HIT: ${{ steps.cache-python.outputs.cache-hit }}
run: |
if [[ "$CACHE_HIT" != 'true' ]]; then
make .venv/bin/activate
fi