ActivityWatch/aw-watcher-window

View on GitHub
.github/workflows/build.yml

Summary

Maintainability
Test Coverage
name: Build

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  test:
    name: test on ${{ matrix.os }} (py-${{ matrix.python_version }})
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-20.04, windows-latest, macOS-12]
        python_version: [3.9]
    steps:
    - uses: actions/checkout@v3
      with:
        submodules: 'recursive'
    - name: Set up Python
      uses: actions/setup-python@v4
      with:
        python-version: ${{ matrix.python_version }}
    - name: Create virtualenv
      shell: bash
      run: |
        python -m venv venv
    - name: Install dependencies
      shell: bash
      run: |
        # we need poetry==1.3.2
        # due to: https://github.com/python-poetry/poetry/issues/7611 
        # seen in: https://github.com/ActivityWatch/aw-watcher-window/actions/runs/5891369412/job/15978283144
        pip install poetry==1.3.2  
        source venv/bin/activate || source venv/Scripts/activate
        make build
    - name: Run tests
      shell: bash
      run: |
        source venv/bin/activate || source venv/Scripts/activate
        make test
    - name: Package
      shell: bash
      run: |
        source venv/bin/activate || source venv/Scripts/activate
        make package
    - name: Test package
      shell: bash
      run: |
          dist/aw-watcher-window/aw-watcher-window --help
    - name: Upload package
      uses: actions/upload-artifact@v3
      with:
        name: aw-watcher-window-${{ runner.os }}-py${{ matrix.python_version }}
        path: dist/aw-watcher-window

  typecheck:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3
      with:
        submodules: 'recursive'
    - name: Set up Python
      uses: actions/setup-python@v4
      with:
        python-version: 3.9
    - name: Create virtualenv
      shell: bash
      run: |
        python -m venv venv
    - name: Install dependencies
      shell: bash
      run: |
        pip install poetry
        source venv/bin/activate || source venv/Scripts/activate
        make build
    - name: Typecheck
      shell: bash
      run: |
        source venv/bin/activate || source venv/Scripts/activate
        make typecheck