add auto generating changlog to workflow #251
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: govcookiecutter template build | |
on: [ pull_request ] | |
jobs: | |
template-build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
# TODO: Fix R pre-commit hook issues with Windows | |
os: [ ubuntu-latest, macos-latest ] | |
python: [ 3.8, 3.9, '3.10' ] | |
R: | |
- {using_R: No, version: N/A} | |
- {using_R: Yes, version: 4.1.3} | |
- {using_R: Yes, version: 4.2.2} | |
steps: | |
- name: Checkout the revision | |
uses: actions/checkout@v3 | |
with: | |
path: ga-govcookiecutter | |
- name: Set up Python ${{ matrix.python }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install R ${{ matrix.R.version }} | |
uses: r-lib/actions/setup-r@v2 | |
with: | |
r-version: ${{ matrix.R.version }} | |
if: ${{ matrix.R.using_r == 'Yes' }} | |
- name: Install other ${{ matrix.os }} R dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install libcurl4-openssl-dev | |
sudo apt-get install libgit2-dev | |
sudo apt-get install libharfbuzz-dev | |
sudo apt-get install libfribidi-dev | |
if: ${{ matrix.os == 'ubuntu-latest' && matrix.R.using_R == 'Yes' }} | |
- name: Install extra macos R dependencies | |
run: | | |
brew install harfbuzz | |
brew install fribidi | |
if: ${{ matrix.os == 'macos-latest' && matrix.R.using_R == 'Yes' }} | |
- name: Install cookiecutter | |
run: | | |
if [ "$RUNNER_OS" == "Linux" ]; then | |
# TODO: Add pip alternative, as Ubuntu 20.04LTS not currently supported (June 2021) | |
sudo apt-get install cookiecutter || pip install cookiecutter | |
elif [ "$RUNNER_OS" == "macOS" ]; then | |
brew install cookiecutter | |
elif [ "$RUNNER_OS" == "Windows" ]; then | |
pip install cookiecutter | |
else | |
echo "$RUNNER_OS not supported" | |
exit 1 | |
fi; | |
shell: bash | |
- name: Create project from govcookiecutter for this commit | |
run: cookiecutter ga-govcookiecutter --no-input repo_name=example using_R=${{ matrix.R.using_R }} | |
shell: bash | |
- name: Install requirements, and pre-commit hooks, and check Sphinx build | |
run: | | |
cd example | |
git init | |
git add . | |
if [[ "$RUNNER_OS" == "Linux" || "$RUNNER_OS" == "macOS" ]]; then | |
make docs | |
elif [ "$RUNNER_OS" == "Windows" ]; then | |
pip install -U pip setuptools | |
pip install -e .[dev] | |
pre-commit install | |
sphinx-build -b html ./docs ./docs/_build | |
else | |
echo "$RUNNER_OS not supported" | |
exit 1 | |
fi; | |
shell: bash | |
- name: Run pre-commit hooks | |
run: | | |
cd example | |
pre-commit run --all-files | |
# TODO: Currently no tests - this gives exit code 5, which fails CI, so commenting out for now | |
# pytest |