diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cad2acaca..003716cbe 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 }} diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 9d45cb7b3..54d4768a6 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -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 '' > index.html - fi - - if [[ ${{ steps.docs.outputs.commit_type }} == "tag" ]]; then - echo update index.html to point at ${{ steps.docs.outputs.current_version }} - echo '' > 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 diff --git a/.github/workflows/ironpython.yml b/.github/workflows/ironpython.yml deleted file mode 100644 index 3085fe0d3..000000000 --- a/.github/workflows/ironpython.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: ironpython - -on: - push: - branches: - - main - pull_request: - branches: - - main - -jobs: - build: - name: windows-ironpython - runs-on: windows-latest - steps: - - uses: actions/checkout@v2 - - name: Install 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: Run tests - env: - IRONPYTHONPATH: ./src - run: | - ipy tests/ipy_test_runner.py diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml new file mode 100644 index 000000000..fa70e3121 --- /dev/null +++ b/.github/workflows/pr-checks.yml @@ -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 }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 27ec4d01c..099367da2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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: |