From b573f5601b19d61e3f8eb68ae52c80c7c975028c Mon Sep 17 00:00:00 2001 From: Heinrich Kuttler Date: Mon, 20 Sep 2021 13:34:58 +0200 Subject: [PATCH] Add copyright header to test_system.py, add GH workflow check for that. --- .github/workflows/test_and_deploy.yml | 21 ++++++++++++++++++++- nle/tests/test_system.py | 1 + 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_and_deploy.yml b/.github/workflows/test_and_deploy.yml index 743a38e88..66ec54b7f 100644 --- a/.github/workflows/test_and_deploy.yml +++ b/.github/workflows/test_and_deploy.yml @@ -13,6 +13,26 @@ on: jobs: + test_license: + name: Check license headers + steps: + - uses: actions/checkout@v2 + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v1.1.2 + + - name: Check copyright header in added files + - shell: bash + - run: | + missing=0 + for file in "${{ steps.changed-files.outputs.added_files }}"; do + if ! egrep -q '(Facebook, Inc(\.|,)? and its affiliates)|([0-9]{4}-present(\.|,)? Facebook)|([0-9]{4}(\.|,)? Facebook)' $file + echo "Missing copyright header in $file" + missing=$(expr $missing + 1) + done + exit $missing + test_repo: name: Test on ${{ matrix.os }} w/ Py${{ matrix.python-version }} runs-on: ${{ matrix.os }} @@ -142,4 +162,3 @@ jobs: with: user: __token__ password: ${{ secrets.PYPI_TOKEN }} -... diff --git a/nle/tests/test_system.py b/nle/tests/test_system.py index e2131bd37..3a43027fb 100644 --- a/nle/tests/test_system.py +++ b/nle/tests/test_system.py @@ -1,3 +1,4 @@ +# Copyright (c) Facebook, Inc. and its affiliates. import multiprocessing as mp import gym