From b07e4ec5853509fdf1ac572ca30b42a7d04a79d7 Mon Sep 17 00:00:00 2001 From: Phil Quitslund Date: Mon, 26 Apr 2021 09:38:56 -0700 Subject: [PATCH 1/4] simple package validation --- .github/workflows/validate.yml | 38 ++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/validate.yml diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml new file mode 100644 index 0000000..aea4e41 --- /dev/null +++ b/.github/workflows/validate.yml @@ -0,0 +1,38 @@ +name: validate + +# Controls when the action will run. +on: + # Triggers the workflow on push or pull request events but only for the main branch + push: + branches: [ main ] + pull_request: + branches: [ main ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + + # Runs a single command using the runners shell + - name: Run a one-line script + run: echo Hello, world! + + # test for license to validate this is working... + - name: Check for sources + run: | + filecount=`find . -name 'LICENSE' | wc -l` + if [[ $filecount -ne 0 ]] + then + echo 'Dart sources are not allowed in this package!' + exit 1 + fi From 7ce919145c2de53fca9f9086eba88bc799181bc8 Mon Sep 17 00:00:00 2001 From: Phil Quitslund Date: Mon, 26 Apr 2021 09:41:07 -0700 Subject: [PATCH 2/4] => dart extensions --- .github/workflows/validate.yml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index aea4e41..4bf2d52 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -13,24 +13,15 @@ on: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - # This workflow contains a single job called "build" build: - # The type of runner that the job will run on runs-on: ubuntu-latest - # Steps represent a sequence of tasks that will be executed as part of the job steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v2 - # Runs a single command using the runners shell - - name: Run a one-line script - run: echo Hello, world! - - # test for license to validate this is working... - name: Check for sources run: | - filecount=`find . -name 'LICENSE' | wc -l` + filecount=`find . -name '*.dart' | wc -l` if [[ $filecount -ne 0 ]] then echo 'Dart sources are not allowed in this package!' From 2a0d775f538b162ed422ac21f6fab6f62fea25b7 Mon Sep 17 00:00:00 2001 From: Phil Quitslund Date: Mon, 26 Apr 2021 10:06:00 -0700 Subject: [PATCH 3/4] check for dirs --- .github/workflows/validate.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 4bf2d52..ba99efe 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -21,9 +21,8 @@ jobs: - name: Check for sources run: | - filecount=`find . -name '*.dart' | wc -l` - if [[ $filecount -ne 0 ]] - then + if [ -d "lib" ] || [ -d "bin" ] + then echo 'Dart sources are not allowed in this package!' exit 1 - fi + fi From 0f50f908b49b20ccee9dcc5ae8ecd84d5a39a7c3 Mon Sep 17 00:00:00 2001 From: Phil Quitslund Date: Mon, 26 Apr 2021 10:28:44 -0700 Subject: [PATCH 4/4] lib check --- .github/workflows/validate.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index ba99efe..a3ea9f8 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -21,7 +21,8 @@ jobs: - name: Check for sources run: | - if [ -d "lib" ] || [ -d "bin" ] + filecount=`find lib -name '*.dart' | wc -l` + if [ $filecount -ne 0 ] || [ -d "bin" ] then echo 'Dart sources are not allowed in this package!' exit 1