-
Notifications
You must be signed in to change notification settings - Fork 74
63 lines (57 loc) · 1.95 KB
/
main.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
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Python Nomad Test and Publish
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
registry_package:
types: [published]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
env:
NOMAD_IP: '127.0.0.1'
NOMAD_PORT: '4646'
strategy:
fail-fast: false
matrix:
python-version: ['3.7', '3.12'] # the oldest and newest support versions
nomad-version: ['1.2.16', '1.3.16', '1.4.14', '1.5.17', '1.6.10', '1.7.7']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Setup Nomad ${{ matrix.nomad-version }}
env:
NOMAD_VERSION: ${{ matrix.nomad-version }}
shell: bash
run: |
echo ${NOMAD_VERSION}
echo "downloading nomad"
curl -L -o /tmp/nomad_${NOMAD_VERSION}_linux_amd64.zip https://releases.hashicorp.com/nomad/${NOMAD_VERSION}/nomad_${NOMAD_VERSION}_linux_amd64.zip
echo "unzip nomad"
unzip -d /usr/local/bin/ /tmp/nomad_${NOMAD_VERSION}_linux_amd64.zip
- name: Install Dependencies
shell: bash
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install -r requirements-dev.txt
- name: Before Tests
shell: bash
run: |
nomad init example.nomad
nomad run -output example.nomad > example.json
- name: Unit and Integration Tests
env:
NOMAD_VERSION: ${{ matrix.nomad-version }}
shell: bash
run: |
./run_tests.sh
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4