-
Notifications
You must be signed in to change notification settings - Fork 12
75 lines (73 loc) · 2.21 KB
/
test.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
inputs: {}
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
Lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633
- name: Set up Python
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Black
run: |
black --check tfparse tests
- name: Flake8
run: |
flake8 tfparse tests
Tests:
needs: Lint
runs-on: ${{ matrix.runner }}
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
runner: ["ubuntu-latest", "windows-latest", "macos-latest"]
exclude:
# just conserving runners by excluding older versions
- runner: macos-latest
python-version: 3.10
- runner: windows-latest
python-version: 3.10
steps:
- name: Checkout
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d
with:
python-version: ${{ matrix.python-version }}
- name: Set up Terraform
uses: hashicorp/setup-terraform@a1502cd9e758c50496cc9ac5308c4843bcd56d36
with:
terraform_wrapper: false
- name: Set up Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491
with:
go-version: "1.21.5"
cache: true
cache-dependency-path: "gotfparse/go.sum"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Install package
run: |
pip install -e .
- name: Test with pytest for Python ${{ matrix.python-version }}
run: |
pytest tests