-
Notifications
You must be signed in to change notification settings - Fork 267
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: migrate from Travis and AppVeyor to GitHub Actions
- Loading branch information
1138-4EB
committed
Oct 30, 2019
1 parent
895e8c4
commit 52caa8c
Showing
3 changed files
with
175 additions
and
137 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,175 @@ | ||
name: 'push' | ||
|
||
on: [ push, pull_request ] | ||
|
||
jobs: | ||
|
||
|
||
lin: | ||
strategy: | ||
fail-fast: false | ||
max-parallel: 4 | ||
matrix: | ||
task: [ | ||
37-fmt, | ||
37-lint, | ||
27-unit, | ||
35-unit, | ||
37-unit, | ||
27-docs, | ||
37-docs, | ||
] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: git submodule update | ||
run: git submodule update --init --recursive | ||
if: matrix.task.do == 'docs' | ||
- uses: actions/setup-python@v1 | ||
with: | ||
python-version: 3.7 | ||
- name: install dependencies | ||
run: | | ||
pip install -U pip | ||
pip install -U virtualenv tox | ||
- if: matrix.task != '37-fmt' | ||
name: run job | ||
env: | ||
TASK: ${{ matrix.task }} | ||
run: | | ||
tox -e py${TASK} | ||
- if: matrix.task == '37-fmt' | ||
name: "[py37-fmt only] run 'black'" | ||
run: tox -e py37-fmt -- --check | ||
|
||
- name: '[py37-docs && push only] publish site to gh-pages' | ||
if: matrix.task == '37-docs' && github.event_name != 'pull_request' | ||
env: | ||
GH_SHA: ${{ github.sha }} | ||
GH_DEPKEY: ${{ secrets.VUNIT_GITHUB_IO_DEPLOY_KEY }} | ||
run: | | ||
cd .tox/py37-docs/tmp/docsbuild/ | ||
touch .nojekyll | ||
git init | ||
git add . | ||
git config --local user.email "push@gha" | ||
git config --local user.name "GHA" | ||
git commit -a -m "update $GH_SHA" | ||
git remote add origin git@github.com:VUnit/VUnit.github.io | ||
eval `ssh-agent -t 60 -s` | ||
echo "$GH_DEPKEY" | ssh-add - | ||
mkdir -p ~/.ssh/ | ||
ssh-keyscan github.com >> ~/.ssh/known_hosts | ||
git push -u origin +master | ||
ssh-agent -k | ||
docker: | ||
strategy: | ||
fail-fast: false | ||
max-parallel: 3 | ||
matrix: | ||
task: [ | ||
{do: 27-acceptance, tag: mcode-2}, | ||
{do: 38-acceptance, tag: llvm}, | ||
{do: 38-vcomponents, tag: mcode}, | ||
] | ||
runs-on: ubuntu-latest | ||
env: | ||
DOCKER_REGISTRY: docker.pkg.github.com | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: git submodule update | ||
run: git submodule update --init --recursive | ||
- name: docker login | ||
run: echo "$GH_TOKEN" | docker login -u vunit-gha --password-stdin "$DOCKER_REGISTRY" | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: run job | ||
env: | ||
IMAGE: docker.pkg.github.com/vunit/vunit/dev:${{ matrix.task.tag }} | ||
BUILD_NAME: py${{ matrix.task.do }}-ghdl | ||
run: | | ||
docker run --rm -tv $(pwd):/src -w /src "$IMAGE" tox -e $BUILD_NAME | ||
- name: docker logout | ||
run: docker logout "$DOCKER_REGISTRY" | ||
if: always() | ||
|
||
|
||
win: | ||
strategy: | ||
fail-fast: false | ||
max-parallel: 4 | ||
matrix: | ||
task: [ | ||
27-acceptance-ghdl, | ||
37-acceptance-ghdl, | ||
37-vcomponents-ghdl, | ||
37-lint, | ||
27-unit, | ||
35-unit, | ||
37-unit, | ||
27-docs, | ||
37-docs, | ||
] | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: git submodule update | ||
run: git submodule update --init --recursive | ||
if: (endsWith( matrix.task, '-lint' ) || endsWith( matrix.task, '-unit' )) == false | ||
- uses: actions/setup-python@v1 | ||
with: | ||
python-version: 3.7 | ||
- name: install dependencies | ||
run: | | ||
pip install -U pip | ||
pip install -U virtualenv tox | ||
- name: install GHDL | ||
if: endsWith( matrix.task, '-ghdl' ) | ||
shell: bash | ||
run: | | ||
curl -fsSL -o ghdl.zip https://github.com/ghdl/ghdl/releases/download/v0.36/ghdl-0.36-mingw32-mcode.zip | ||
7z x ghdl.zip "-o../ghdl" -y | ||
mv ../ghdl/GHDL/0.36-mingw32-mcode/ ../ghdl-v0.36 | ||
rm -rf ../ghdl ghdl.zip | ||
- name: run job | ||
shell: bash | ||
env: | ||
TASK: ${{ matrix.task }} | ||
run: | | ||
export PATH=$PATH:$(pwd)/../ghdl-v0.36/bin | ||
tox -e py${TASK} | ||
# Deploy to PyPI whenever a release is pushed | ||
# When a package version has not changed a new upload will not be triggered | ||
deploy: | ||
runs-on: ubuntu-latest | ||
needs: [ lin, docker, win ] | ||
if: github.event_name == 'release' && github.event.action == 'created' | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: git submodule update | ||
run: git submodule update --init --recursive | ||
- uses: actions/setup-python@v1 | ||
with: | ||
python-version: 3.7 | ||
- name: install dependencies | ||
run: | | ||
pip install --upgrade pip | ||
pip install setuptools wheel twine | ||
- name: build and deploy to PyPI | ||
env: | ||
TWINE_USERNAME: ${{ secrets.PYPI_USER }} | ||
TWINE_PASSWORD: ${{ secrets.PYPI_PASS }} | ||
run: | | ||
python tools/release.py validate | ||
#python setup.py sdist bdist_wheel | ||
#twine upload dist/* | ||
echo "This is a placeholder for deployment to PyPI" |
This file was deleted.
Oops, something went wrong.