Skip to content

Merge pull request #7 from bourdaisj/docker-setup #40

Merge pull request #7 from bourdaisj/docker-setup

Merge pull request #7 from bourdaisj/docker-setup #40

name: Test and Release
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: "3.9"
# Install and run pre-commit
- run: |
pip install pre-commit
pre-commit install
pre-commit run --all-files
pytest:
name: Pytest ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
python-version: [3.9]
config:
- {
name: "Linux",
os: ubuntu-latest
}
# Moose is not working on x86_64 Mac because the following command has
# dependency conflicts in the solver between Moose and ParaView:
# micromamba create -n moose python=3.9 moose paraview -y -c https://conda.software.inl.gov/public
# - {
# name: "MacOSX",
# os: macos-latest
# }
# Moose is not available at all on Windows, so skip testing Windows
defaults:
run:
# The "-l {0}" is needed to make sure .bashrc is activated
# We need this for micromamba to be locatable.
shell: bash -l {0}
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: mamba-org/setup-micromamba@v1
with:
init-shell: bash
# EGL is required to import ParaView on Linux
- name: Install EGL (Linux)
if: ${{ matrix.config.name == 'Linux' }}
run: |
sudo apt-get update
sudo apt-get install -y libegl1
- name: Install Moose and ParaView
run: |
micromamba create -n moose python=3.9 moose paraview -y -c https://conda.software.inl.gov/public
- name: Install and Run Tests
run: |
micromamba activate moose
pip install .
pip install -r tests/requirements.txt
pytest -s ./tests
test-npm-build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set Up Node
uses: actions/setup-node@v3
with:
node-version: 18
- name: Build Vue Components
run: |
export NODE_OPTIONS=--openssl-legacy-provider
cd vue-components
npm ci
npm run build
release:
needs: [
pre-commit,
# pytest,
test-npm-build,
]
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set Up Node
uses: actions/setup-node@v3
with:
node-version: 18
- name: Build Vue Components
run: |
export NODE_OPTIONS=--openssl-legacy-provider
cd vue-components
npm ci
npm run build
- name: Python Semantic Release
uses: relekang/python-semantic-release@v7.34.6
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
repository_username: __token__
repository_password: ${{ secrets.PYPI_API_TOKEN }}