From b94a92d2e43036c2f3cf571def11a5504ac8ae4f Mon Sep 17 00:00:00 2001 From: Fei Zhang Date: Tue, 22 Sep 2020 10:23:00 +1000 Subject: [PATCH 1/4] Begin a branch to test use github actions --- .github/workflows/hiperseis_main_ci.yml | 36 +++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/hiperseis_main_ci.yml diff --git a/.github/workflows/hiperseis_main_ci.yml b/.github/workflows/hiperseis_main_ci.yml new file mode 100644 index 00000000..e6aa9893 --- /dev/null +++ b/.github/workflows/hiperseis_main_ci.yml @@ -0,0 +1,36 @@ +# This workflow is setup by Fei Zhang to use Github Actions 202-09-14 + +name: hiperseis_main_ci + +on: [push] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.7, 3.8] + + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 pytest + sudo apt-get install proj-bin + pip install numpy + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi +# - name: Lint with flake8 +# run: | +# # stop the build if there are Python syntax errors or undefined names +# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics +# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide +# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test with pytest + run: | + python -m pytest ./tests From d2250f425c0b1ae8c0208f7a25aa0410e59bb664 Mon Sep 17 00:00:00 2001 From: zhang01GA Date: Wed, 30 Sep 2020 10:49:26 +1000 Subject: [PATCH 2/4] github action yml file --- .github/workflows/hiperseis_main_ci.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/hiperseis_main_ci.yml b/.github/workflows/hiperseis_main_ci.yml index e6aa9893..bfd61955 100644 --- a/.github/workflows/hiperseis_main_ci.yml +++ b/.github/workflows/hiperseis_main_ci.yml @@ -20,10 +20,22 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | + sudo apt-get install libhdf5-dev + sudo apt-get install libmpich-dev + sudo apt-get install libproj-dev proj-bin + sudo apt-get install libgeos-dev + sudo apt-get install libnetcdf-dev + python -m pip install --upgrade pip - pip install flake8 pytest - sudo apt-get install proj-bin + pip install numpy + pip install Cython --install-option="--no-cython-compile" + pip install flake8 pytest + pip install pytest-cov + pip install coveralls + pip install pip-tools + pip-compile --upgrade + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi # - name: Lint with flake8 # run: | From 46077e66d7f57616e7e5530dfe897cbd9f17dd3e Mon Sep 17 00:00:00 2001 From: zhang01GA Date: Wed, 30 Sep 2020 11:07:26 +1000 Subject: [PATCH 3/4] github action yml file adding install -r tests/requirements.txt --- .github/workflows/hiperseis_main_ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/hiperseis_main_ci.yml b/.github/workflows/hiperseis_main_ci.yml index bfd61955..b690e163 100644 --- a/.github/workflows/hiperseis_main_ci.yml +++ b/.github/workflows/hiperseis_main_ci.yml @@ -37,12 +37,15 @@ jobs: pip-compile --upgrade if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + pip install -r tests/requirements.txt + pip list # - name: Lint with flake8 # run: | # # stop the build if there are Python syntax errors or undefined names # flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics # # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide # flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - name: Test with pytest + - name: Running pytest run: | python -m pytest ./tests + From fae36772fbd93472e8d07b46a065b039b4fa9d92 Mon Sep 17 00:00:00 2001 From: zhang01GA Date: Wed, 30 Sep 2020 11:54:03 +1000 Subject: [PATCH 4/4] github action yml file submodule checkout phasepapy --- .github/workflows/hiperseis_main_ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/hiperseis_main_ci.yml b/.github/workflows/hiperseis_main_ci.yml index b690e163..36b21cf2 100644 --- a/.github/workflows/hiperseis_main_ci.yml +++ b/.github/workflows/hiperseis_main_ci.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.7, 3.8] + python-version: [3.6, 3.7] steps: - uses: actions/checkout@v2 @@ -20,6 +20,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | + git submodule update --init --recursive sudo apt-get install libhdf5-dev sudo apt-get install libmpich-dev sudo apt-get install libproj-dev proj-bin