-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Use the new mithro/actions-includes for common functionality. - Refactor common functionality into their own include actions. Signed-off-by: Tim 'mithro' Ansell <[email protected]>
- Loading branch information
Showing
13 changed files
with
995 additions
and
149 deletions.
There are no files selected for viewing
10 changes: 9 additions & 1 deletion
10
.github/workflows/checkout/action.yaml → .github/actions/checkout/action.yaml
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Copyright (C) 2021 The SymbiFlow Authors. | ||
# | ||
# Use of this source code is governed by a ISC-style | ||
# license that can be found in the LICENSE file or at | ||
# https://opensource.org/licenses/ISC | ||
# | ||
# SPDX-License-Identifier: ISC | ||
|
||
name: "Publish packages into PyPI" | ||
description: "Check the packages and then publish packages onto Test and real versions." | ||
inputs: | ||
type: | ||
description: 'Type of packages to publish to PyPi.' | ||
required: true | ||
root_repo: | ||
description: 'Repository name that should be publishing packages to PyPi.' | ||
required: true | ||
root_branch: | ||
description: 'Default branch to publish packages from.' | ||
required: true | ||
default: refs/heads/master | ||
|
||
runs: | ||
using: "includes" | ||
|
||
steps: | ||
- name: ✔︎ Check 📦 | ||
run: | | ||
for WHEEL in dist/*.whl; do | ||
echo | ||
echo "::group::Checking $WHEEL" | ||
echo | ||
python -m zipfile --list $WHEEL | ||
echo | ||
auditwheel show $WHEEL | ||
echo | ||
twine check $WHEEL | ||
echo | ||
echo "::endgroup::" | ||
done | ||
- name: 📤 Publish ${{ inputs.type }} to Test PyPI | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI_TEST_PASSWORD }} | ||
if: env.TWINE_PASSWORD != null | ||
run: | | ||
twine upload --skip-existing --verbose --repository testpypi dist/* | ||
- name: 📤 Publish source to PyPI | ||
if: | | ||
(github.ref == inputs.root_branch) && | ||
(github.event_name != 'pull_request') && | ||
(github.repository == inputs.root_repo) && | ||
env.TWINE_PASSWORD != null | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
run: | | ||
twine upload dist/* |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Copyright (C) 2017-2021 The SymbiFlow Authors. | ||
# | ||
# Use of this source code is governed by a ISC-style | ||
# license that can be found in the LICENSE file or at | ||
# https://opensource.org/licenses/ISC | ||
# | ||
# SPDX-License-Identifier: ISC | ||
|
||
# Set up a Python environment to run the actions_include tool on. | ||
ENV_DIR = venv | ||
PYTHON = $(ENV_DIR)/bin/python3 | ||
ACTIVATE = source $(ENV_DIR)/bin/activate; | ||
|
||
env: requirements.txt | ||
rm -rf $(ENV_DIR) | ||
virtualenv --copies $(ENV_DIR) | ||
$(ACTIVATE) pip install -r $< | ||
touch --reference=$< $(PYTHON) | ||
|
||
.PHONY: env | ||
|
||
$(PYTHON): requirements.txt | ||
make env | ||
|
||
# Generate the output files | ||
SRC_YAML = $(wildcard *.yml) | ||
OUT_YAML = $(addprefix ../workflows/,$(SRC_YAML)) | ||
|
||
../workflows/%.yml: %.yml | $(PYTHON) | ||
$(ACTIVATE) python -m actions_includes $< $@ | ||
|
||
update: | ||
@for F in $(SRC_YAML); do touch $$F; done | ||
make build | ||
|
||
build: $(OUT_YAML) | $(PYTHON) | ||
@true | ||
|
||
info: | ||
@echo 'Output files: $(OUT_YAML)' | ||
|
||
.PHONY: info |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Copyright (C) 2017-2021 The SymbiFlow Authors. | ||
# | ||
# Use of this source code is governed by a ISC-style | ||
# license that can be found in the LICENSE file or at | ||
# https://opensource.org/licenses/ISC | ||
# | ||
# SPDX-License-Identifier: ISC | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
name: Functionality | ||
jobs: | ||
|
||
functionality: | ||
runs-on: ubuntu-20.04 | ||
|
||
strategy: | ||
matrix: | ||
antlr_runtime_type: [static, shared] | ||
include: | ||
- { python-version: 3.5, TOXENV: py35 } | ||
- { python-version: 3.6, TOXENV: py36 } | ||
- { python-version: 3.7, TOXENV: py37 } | ||
- { python-version: 3.8, TOXENV: py38 } | ||
- { python-version: 3.9, TOXENV: py39 } | ||
fail-fast: false | ||
|
||
name: Functionality on Python ${{ matrix.python-version }} (with ${{ matrix.antlr_runtime_type}} antlr) | ||
|
||
steps: | ||
- includes: /system-setup | ||
with: | ||
development-tools: true | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Run Tests | ||
run: | | ||
ANTLR4_RUNTIME_TYPE=${{ matrix.antlr_runtime_type }} tox -e ${{ matrix.TOXENV }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
# Copyright (C) 2017-2021 The SymbiFlow Authors. | ||
# | ||
# Use of this source code is governed by a ISC-style | ||
# license that can be found in the LICENSE file or at | ||
# https://opensource.org/licenses/ISC | ||
# | ||
# SPDX-License-Identifier: ISC | ||
|
||
name: Install from | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
|
||
jobs: | ||
|
||
GitHub: | ||
strategy: | ||
matrix: | ||
os: [windows-latest, macos-latest, ubuntu-20.04] | ||
fail-fast: false | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- includes: /system-setup | ||
with: | ||
os: ${{ matrix.os }} | ||
git-checkout: false | ||
|
||
- name: Test installation | ||
shell: bash | ||
run: | | ||
pip install git+https://github.com/${GITHUB_REPOSITORY}.git@${GITHUB_SHA}#egg=fasm | ||
- name: Run smoke test | ||
run: | | ||
fasm --help | ||
# - name: Run tests against installed version | ||
# run: | | ||
# cd tests; python test_simple.py | ||
|
||
Checkout: | ||
strategy: | ||
matrix: | ||
os: [windows-latest, macos-latest, ubuntu-20.04] | ||
cmd: | ||
- python setup.py install | ||
- pip install . | ||
- pip install -e . # Editable install | ||
fail-fast: false | ||
|
||
name: Checkout with '${{ matrix.cmd }}' (${{ matrix.os }}) | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- includes: /system-setup | ||
with: | ||
os: ${{ matrix.os }} | ||
|
||
- name: Install using '${{ matrix.cmd }}' | ||
run: | | ||
${{ matrix.cmd }} | ||
- name: Run smoke test | ||
run: | | ||
fasm --help | ||
- name: Run tests against installed version | ||
run: | | ||
cd tests; python test_simple.py | ||
Wheel: | ||
strategy: | ||
matrix: | ||
os: [windows-latest, macos-latest, ubuntu-20.04] | ||
fail-fast: false | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- includes: /system-setup | ||
with: | ||
os: ${{ matrix.os }} | ||
|
||
- name: Build wheel | ||
run: | | ||
python setup.py bdist_wheel | ||
- name: Upload wheel | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: fasm | ||
path: dist | ||
|
||
- name: Install wheel | ||
run: | | ||
pip install dist/*.whl | ||
- name: Run smoke test | ||
run: | | ||
fasm --help | ||
- name: Run tests against installed version | ||
run: | | ||
cd tests; python test_simple.py | ||
make-env: | ||
strategy: | ||
matrix: | ||
os: [windows-latest, macos-latest, ubuntu-20.04] | ||
fail-fast: false | ||
|
||
name: make-env (Conda) | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- includes: /system-setup | ||
with: | ||
os: ${{ matrix.os }} | ||
|
||
- name: Run tests | ||
run: | | ||
make tests |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Copyright (C) 2021 The SymbiFlow Authors. | ||
# | ||
# Use of this source code is governed by a ISC-style | ||
# license that can be found in the LICENSE file or at | ||
# https://opensource.org/licenses/ISC | ||
# | ||
# SPDX-License-Identifier: ISC | ||
|
||
name: Style | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
|
||
Style: | ||
runs-on: ubuntu-20.10 | ||
|
||
steps: | ||
- includes: /system-setup | ||
with: | ||
development-tools: true | ||
|
||
- name: Check license headers | ||
run: make check-license | ||
|
||
- name: Python style check | ||
run: | | ||
make format lint | ||
test $(git status --porcelain | wc -l) -eq 0 || { git diff; false; } | ||
- name: Python script checks | ||
run: make check-python-scripts | ||
|
||
- name: C++ style check | ||
run: | | ||
make format-cpp | ||
test $(git status --porcelain | wc -l) -eq 0 || { git diff; false; } |
Oops, something went wrong.