name: ci

on: [pull_request, push]

jobs:
  test:
    name: Lint test
    runs-on: ubuntu-18.04
    steps:
      - uses: actions/checkout@master
      - name: Setup Python
        uses: actions/setup-python@v1
        with:
          python-version: 3.7
      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
      - name: Lint with flake8
        run: |
          pip install flake8
          flake8 . --max-line-length=130
  buildx:
    runs-on: ubuntu-18.04
    needs: test
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Set up QEMU
        uses: docker/setup-qemu-action@v1
      - name: Set up Docker Buildx
        id: buildx
        uses: docker/setup-buildx-action@v1
      - name: Available platforms
        run: echo ${{ steps.buildx.outputs.platforms }}
      - name: Run Buildx
        run: |
          docker buildx build \
          --platform linux/arm/v7,linux/arm64 .