-
Notifications
You must be signed in to change notification settings - Fork 1
60 lines (56 loc) · 1.8 KB
/
pre-commit.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
58
59
60
name: Check code/commit conventions
on: push
jobs:
switchover-queu-tests:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Install asdf
uses: asdf-vm/actions/setup@v3
- name: Cache tools
uses: actions/cache@v4
with:
path: /home/runner/.asdf
key: ${{ runner.os }}-${{ hashFiles('**/.tool-versions') }}
- name: Install required tools
run: |
cat .tool-versions | cut -f 1 -d ' ' | xargs -n 1 asdf plugin-add || true
asdf plugin-update --all
asdf install
asdf reshim
- name: Rerun Pre-Commit Hooks on CI
run: |
pip install -r requirements.txt
asdf reshim
pre-commit run --color=always --show-diff-on-failure --all-files
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-dev-cache
key: ${{ runner.os }}-buildx-dev-${{ github.sha }}
restore-keys: ${{ runner.os }}-buildx-dev-
- name: Build Test Docker image
uses: docker/build-push-action@v5
with:
context: .
push: false
load: true
tags: switchover-test
file: Dockerfile-test
cache-from: type=local,src=/tmp/.buildx-dev-cache
cache-to: type=local,dest=/tmp/.buildx-dev-cache-new
- name: Move cache
run: |
rm -rf /tmp/.buildx-dev-cache
mv /tmp/.buildx-dev-cache-new /tmp/.buildx-dev-cache
- name: Run tests
run: docker run switchover-test
commitlint:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v5