Skip to content

Commit

Permalink
Merge pull request #4 from compas-dev/workflow
Browse files Browse the repository at this point in the history
update workflows
  • Loading branch information
Licini authored Nov 9, 2023
2 parents a242bbf + 312b2e7 commit 9d3abc9
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 119 deletions.
34 changes: 7 additions & 27 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,38 +8,18 @@ on:
branches:
- main

defaults:
run:
shell: bash -l {0}


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

steps:

- uses: actions/checkout@v2

- uses: conda-incubator/setup-miniconda@v2.0.0
- uses: compas-dev/compas-actions.build@v3
with:
miniconda-version: "latest"
activate-environment: gmsh
channels: conda-forge

- name: build
run: |
conda install compas -y
pip install -r requirements-dev.txt
- name: Lint with flake8
run: |
invoke lint
- name: Test with pytest
run: |
invoke test
invoke_lint: true
check_import: true
python: ${{ matrix.python }}
67 changes: 3 additions & 64 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,70 +11,9 @@ on:
- main

jobs:
build:
name: build and deploy docs
docs:
runs-on: windows-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v2

- uses: conda-incubator/setup-miniconda@v2.0.0
with:
miniconda-version: "latest"
activate-environment: gmsh
channels: conda-forge
python-version: 3.8

- name: build
run: |
conda install compas -y
pip install -r requirements-dev.txt
invoke docs
- uses: compas-dev/compas-actions.docs@v1.0.2
id: docs
with:
dest: deploy
build_to_subfolder: true
install_dependencies: false
build_docs: false

- name: Deploy docs
if: success() && steps.docs.outputs.commit_type != 'pull'
uses: crazy-max/ghaction-github-pages@v2
with:
target_branch: gh-pages
build_dir: deploy
keep_history: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

outputs:
commit_type: ${{ steps.docs.outputs.commit_type }}
current_version: ${{ steps.docs.outputs.current_version }}

docVersions:
needs: build
if: needs.build.outputs.commit_type == 'tag'
name: update doc versions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: gh-pages

- uses: compas-dev/compas-actions.docversions@v1.0.1
with:
current_version: ${{ needs.build.outputs.current_version }}

- name: Deploy docs
if: success()
uses: crazy-max/ghaction-github-pages@v2
- uses: compas-dev/compas-actions.docs@v2
with:
target_branch: gh-pages
build_dir: ./
keep_history: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
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 }}
42 changes: 19 additions & 23 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,31 @@
name: Release

on:
push:
tags:
- 'v*'

name: Create Release

jobs:
Release:
runs-on: ubuntu-latest
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest]
python: ['3.8', '3.9', '3.10']

steps:
- uses: actions/checkout@v2
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: compas-dev/compas-actions.build@v2
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false

test_lint: true
test_compas: true
use_conda: true
python: ${{ matrix.python }}

Publish:
needs: Release
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.x'
- uses: compas-dev/compas-actions.publish@v1.0.0
with:
token: ${{ secrets.PYPI }}
- uses: compas-dev/compas-actions.publish@v2
with:
pypi_token: ${{ secrets.PYPI }}
github_token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

* Updated github workflows to latest version.

### Removed


Expand Down
5 changes: 0 additions & 5 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,5 @@
ns.configure(
{
"base_folder": os.path.dirname(__file__),
# "ghuser": {
# "source_dir": "src/compas_ghpython/components",
# "target_dir": "src/compas_ghpython/components/ghuser",
# "prefix": "(COMPAS)",
# },
}
)

0 comments on commit 9d3abc9

Please sign in to comment.