-
Notifications
You must be signed in to change notification settings - Fork 2
57 lines (55 loc) · 1.76 KB
/
ci.yml
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
---
name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9]
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v3
id: cache-pip
with:
path: |
~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/requirements-dev.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- uses: actions/cache@v3
id: cache-shellcheck
with:
path: bin/shellcheck
key: ${{ runner.os }}-shellcheck
restore-keys: |
${{ runner.os }}-shellcheck
- uses: actions/cache@v3
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
- name: Install virtualenv
run: |
sudo apt-get update && sudo apt-get install -y python3-setuptools python3-wheel
- name: Setup bin directories
run: |
mkdir -p "$(pwd)/bin"
export PATH=$(pwd)/bin:$HOME/.local/bin:$PATH
- name: Get shellcheck binary
if: steps.cache-shellcheck.outputs.cache-hit != 'true'
run: |
export SHELLCHECK_VERSION=v0.9.0
wget -qO- https://github.com/koalaman/shellcheck/releases/download/${SHELLCHECK_VERSION}/shellcheck-${SHELLCHECK_VERSION}.linux.x86_64.tar.xz | tar -xJv
mv "shellcheck-${SHELLCHECK_VERSION}/shellcheck" "$(pwd)/bin/shellcheck"
chmod +x "$(pwd)/bin/shellcheck"
- name: Install dependencies
run: |
pip install -r requirements.txt
- name: Lint and test
run: |
timeout 1h make test