Skip to content

add release workflow (#156) #146

add release workflow (#156)

add release workflow (#156) #146

Workflow file for this run

# 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.11'] # the oldest and newest support versions
nomad-version: ['1.0.18', '1.1.18', '1.2.15', '1.3.14', '1.4.9', '1.5.5']
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
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@v3