Skip to content

build

build #219

Workflow file for this run

name: build
on:
pull_request:
push:
branches:
- "master"
- "develop"
schedule:
# Schedule events are triggered by whoever last changed the cron schedule
- cron: "5 0 * * *"
env:
# The only way to simulate if-else statement
CHECKOUT_BRANCH: ${{ github.event_name == 'schedule' && 'develop' || github.ref }}
jobs:
check-pre-commit-hooks:
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v2
with:
ref: ${{ env.CHECKOUT_BRANCH }}
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.8"
architecture: x64
- name: Prepare pre-commit validators
run: |
pip install pre-commit
pre-commit install
- name: Check code compliance with pre-commit validators
run: pre-commit run --all-files
test-on-github:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.8"
- "3.9"
- "3.10"
steps:
- name: Checkout branch
uses: actions/checkout@v2
with:
ref: ${{ env.CHECKOUT_BRANCH }}
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Install packages
run: |
sudo apt-get update
pip install pytest
pip install -r requirements.txt -r requirements-dev.txt
- name: Run tests
run: pytest
mirror-to-gitlab:
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Mirror + trigger CI
uses: SvanBoxel/gitlab-mirror-and-ci-action@master
with:
args: "https://git.sinergise.com/eo/applications/qgis_sentinel_hub/"
env:
GITLAB_HOSTNAME: "git.sinergise.com"
GITLAB_USERNAME: "github-action"
GITLAB_PASSWORD: ${{ secrets.GITLAB_PASSWORD }}
GITLAB_PROJECT_ID: "507"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}