name: license

on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - master

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
    - name: Set up Golang
      uses: actions/setup-go@v2
    - name: Install addlicense
      run: |
        export PATH=${PATH}:`go env GOPATH`/bin
        go get -v -u github.com/google/addlicense
    - name: Check license python
      run: |
        export PATH=${PATH}:`go env GOPATH`/bin
        addlicense -check -l mit -c "Amundsen" $(find $PWD -type f -name '*.py')
    - name: Check license tsx
      run: |
        export PATH=${PATH}:`go env GOPATH`/bin
        addlicense -check -l mit -c "Amundsen" $(find $PWD -type f -name '*.tsx')
