Skip to content

Commit

Permalink
updated workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
chenkasirer committed Jan 16, 2024
1 parent 51dd4b6 commit 6447f90
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 143 deletions.
48 changes: 7 additions & 41 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,52 +9,18 @@ on:
- main

jobs:
build-cpython:
Build:
if: "!contains(github.event.pull_request.labels.*.name, 'docs-only')"
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
os: [macos-latest, windows-latest, ubuntu-latest]
python: ['3.8', '3.9', '3.10']

steps:
- uses: actions/checkout@v3

- name: Installing Python${{ matrix.python }}
uses: actions/setup-python@v4
- uses: compas-dev/compas-actions.build@v3
with:
python-version: ${{ matrix.python }}

- name: Installing package
run: |
python -m pip install --upgrade pip
python -m pip install --no-cache-dir -r requirements-dev.txt
- name: Running linter
run: |
invoke lint
- name: Running unit-tests
run: |
invoke test
build-ironpython:
if: "!contains(github.event.pull_request.labels.*.name, 'docs-only')"
runs-on: windows-latest
steps:
- uses: actions/checkout@v3

- name: Installing dependencies
run: |
curl -o compas.tar.gz -LJO https://pypi.debian.net/compas/COMPAS-2.0.0a2.tar.gz
curl -o ironpython-pytest.tar.gz -LJO https://pypi.debian.net/ironpython-pytest/latest
choco install ironpython --version=2.7.8.1
ipy -X:Frames -m ensurepip
ipy -X:Frames -m pip install --no-deps compas.tar.gz
ipy -X:Frames -m pip install --no-deps ironpython-pytest.tar.gz
- name: Running unit-tests
env:
IRONPYTHONPATH: ./src
run: |
ipy tests/ipy_test_runner.py
invoke_lint: true
check_import: true
use_conda: false
python: ${{ matrix.python }}
77 changes: 5 additions & 72 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,83 +5,16 @@ on:
branches:
- main
tags:
- 'v*'
- "v*"
pull_request:
branches:
- main

jobs:
docs:
runs-on: ubuntu-latest
runs-on: windows-latest
steps:
- uses: actions/checkout@v3

- name: Setup Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Install CPython dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --no-cache-dir -r requirements-dev.txt
- name: 📃 Generate docs
id: docs
shell: bash
run: |
invoke docs --check-links
# Get branch/tag/latest name from git
GITHUB_REF_REGEX="tags/v([0-9a-zA-Z\.\-]+)|(pull/[0-9]+)|heads/(.+)"
if [[ $GITHUB_REF =~ $GITHUB_REF_REGEX ]]; then
if [[ $BASH_REMATCH = pull* ]]; then
BRANCH_OR_TAG=pull_${BASH_REMATCH##*/}
echo "commit_type=pull" >> $GITHUB_OUTPUT
elif [[ $BASH_REMATCH = tags/v* ]]; then
# 2nd element is tag, #v replaces prefix v
BRANCH_OR_TAG=${BASH_REMATCH[1]#v}
echo "commit_type=tag" >> $GITHUB_OUTPUT
else
BRANCH_OR_TAG=${BASH_REMATCH##*/}
fi;
if [[ $BRANCH_OR_TAG = main ]]; then
BRANCH_OR_TAG=latest
echo "commit_type=main" >> $GITHUB_OUTPUT
fi;
fi;
echo "Docs will be deployed to https://gramaziokohler.github.io/compas_timber/$BRANCH_OR_TAG"
mkdir -p deploy/$BRANCH_OR_TAG && mv -T dist/docs deploy/$BRANCH_OR_TAG/
# Check index.html and .nojekyll
- shell: bash -l {0}
run: |
echo check index.html and .nojekyll
cd deploy
if [[ ! -f ".nojekyll" ]]; then
echo creating .nojekyll
> .nojekyll
fi
full_repo=${{ github.repository }}
repo=${full_repo#*/}
if [[ ! -f "index.html" ]]; then
echo creating index.html
echo '<meta http-equiv="refresh" content="0; url=/'$repo'/latest/">' > index.html
fi
if [[ ${{ steps.docs.outputs.commit_type }} == "tag" ]]; then
echo update index.html to point at ${{ steps.docs.outputs.current_version }}
echo '<meta http-equiv="refresh" content="0; url=/'$repo'/${{ steps.docs.outputs.current_version }}/">' > index.html
fi
- name: 🚢 Deploy docs
if: success()
uses: crazy-max/ghaction-github-pages@v3
- uses: compas-dev/compas-actions.docs@v2
with:
target_branch: gh-pages
build_dir: deploy
keep_history: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

github_token: ${{ secrets.GITHUB_TOKEN }}
use_conda: true
29 changes: 0 additions & 29 deletions .github/workflows/ironpython.yml

This file was deleted.

21 changes: 21 additions & 0 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: verify-pr-checklist
on:
pull_request:
types: [assigned, opened, synchronize, reopened, labeled, unlabeled]
branches:
- main
- master

jobs:
build:
name: Check Actions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Changelog check
uses: Zomzog/changelog-checker@v1.2.0
with:
fileName: CHANGELOG.md
checkNotification: Simple
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
with:
source: src/compas_timber/ghpython/components
target: src/compas_timber/ghpython/components/ghuser
prefix: "(COMPAS_TIMBER) "
prefix: "CT: "

- name: Copy manual components
run: |
Expand Down

0 comments on commit 6447f90

Please sign in to comment.