Skip to content

Commit

Permalink
ci: migrate from Travis and AppVeyor to GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
1138-4EB committed Nov 20, 2019
1 parent 39a2bfe commit 60dc1e5
Show file tree
Hide file tree
Showing 3 changed files with 175 additions and 137 deletions.
51 changes: 0 additions & 51 deletions .appveyor.yml

This file was deleted.

175 changes: 175 additions & 0 deletions .github/workflows/push.yml
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"
86 changes: 0 additions & 86 deletions .travis.yml

This file was deleted.

0 comments on commit 60dc1e5

Please sign in to comment.