From 3eb47e200a0d952d9c7b19b41d872efc3d12faf7 Mon Sep 17 00:00:00 2001 From: cfernhout Date: Fri, 13 May 2022 14:23:26 +0200 Subject: [PATCH 01/16] [DAT-3282] Add first GHA workflow unit test --- .github/workflows/on_push.yml | 51 +++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/on_push.yml diff --git a/.github/workflows/on_push.yml b/.github/workflows/on_push.yml new file mode 100644 index 00000000..09acb30d --- /dev/null +++ b/.github/workflows/on_push.yml @@ -0,0 +1,51 @@ +# This is a basic workflow to help you get started with Actions + +name: CI + +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the master branch + push: + paths: + - '**.py' + - '.github/workflows/**' + - '!dev/**' + pull_request: + branches: [ master ] + + # 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" + unit_tests: + runs-on: ubuntu-latest + strategy: + max-parallel: 2 + fail-fast: false + matrix: + python-version: + - "3.7" + - "3.10" + + name: Check Python ${{ matrix.python-version }} + steps: + - uses: actions/checkout@v3 + + - name: Setup Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + + - name: Build the stack + run: docker-compose up -d mysql + + - name: Install Poetry + run: curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python - + + - name: Install package + run: poetry install + + - name: Run unit tests + run: poetry run python3 -m unittest \ No newline at end of file From a6c14a861e44ca06fc77ff3c6ceef8f940ee827f Mon Sep 17 00:00:00 2001 From: cfernhout Date: Fri, 13 May 2022 14:24:44 +0200 Subject: [PATCH 02/16] [DAT-3282] Fix identation --- .github/workflows/on_push.yml | 40 +++++++++++++++++------------------ 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/on_push.yml b/.github/workflows/on_push.yml index 09acb30d..ab4f997f 100644 --- a/.github/workflows/on_push.yml +++ b/.github/workflows/on_push.yml @@ -29,23 +29,23 @@ jobs: - "3.7" - "3.10" - name: Check Python ${{ matrix.python-version }} - steps: - - uses: actions/checkout@v3 - - - name: Setup Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - - name: Build the stack - run: docker-compose up -d mysql - - - name: Install Poetry - run: curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python - - - - name: Install package - run: poetry install - - - name: Run unit tests - run: poetry run python3 -m unittest \ No newline at end of file + name: Check Python ${{ matrix.python-version }} + steps: + - uses: actions/checkout@v3 + + - name: Setup Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + + - name: Build the stack + run: docker-compose up -d mysql + + - name: Install Poetry + run: curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python - + + - name: Install package + run: poetry install + + - name: Run unit tests + run: poetry run python3 -m unittest \ No newline at end of file From f98537e3bbd6960dcfbb4c80ec3c6ad3c51cd750 Mon Sep 17 00:00:00 2001 From: cfernhout Date: Fri, 13 May 2022 14:25:55 +0200 Subject: [PATCH 03/16] [DAT-3282] Change poetry install --- .github/workflows/on_push.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/on_push.yml b/.github/workflows/on_push.yml index ab4f997f..00417070 100644 --- a/.github/workflows/on_push.yml +++ b/.github/workflows/on_push.yml @@ -42,7 +42,7 @@ jobs: run: docker-compose up -d mysql - name: Install Poetry - run: curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python - + run: pip install poetry - name: Install package run: poetry install From 401fe017fc95782c6ab2b21f366922e922c5ad9a Mon Sep 17 00:00:00 2001 From: cfernhout Date: Fri, 13 May 2022 14:29:12 +0200 Subject: [PATCH 04/16] [DAT-3282] Remove unnecessary comments --- .github/workflows/on_push.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/on_push.yml b/.github/workflows/on_push.yml index 00417070..c86bf88b 100644 --- a/.github/workflows/on_push.yml +++ b/.github/workflows/on_push.yml @@ -1,10 +1,6 @@ -# This is a basic workflow to help you get started with Actions - name: CI -# Controls when the workflow will run on: - # Triggers the workflow on push or pull request events but only for the master branch push: paths: - '**.py' @@ -13,12 +9,9 @@ on: pull_request: branches: [ master ] - # 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" unit_tests: runs-on: ubuntu-latest strategy: From a9d3ed6c26e14003ecfc5c28777b8dbf2e4b8aea Mon Sep 17 00:00:00 2001 From: cfernhout Date: Fri, 13 May 2022 14:36:30 +0200 Subject: [PATCH 05/16] [DAT-3282] Change name workflow --- .github/workflows/on_push.yml | 44 ----------------------------------- 1 file changed, 44 deletions(-) delete mode 100644 .github/workflows/on_push.yml diff --git a/.github/workflows/on_push.yml b/.github/workflows/on_push.yml deleted file mode 100644 index c86bf88b..00000000 --- a/.github/workflows/on_push.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: CI - -on: - push: - paths: - - '**.py' - - '.github/workflows/**' - - '!dev/**' - pull_request: - branches: [ master ] - - workflow_dispatch: - -jobs: - unit_tests: - runs-on: ubuntu-latest - strategy: - max-parallel: 2 - fail-fast: false - matrix: - python-version: - - "3.7" - - "3.10" - - name: Check Python ${{ matrix.python-version }} - steps: - - uses: actions/checkout@v3 - - - name: Setup Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - - name: Build the stack - run: docker-compose up -d mysql - - - name: Install Poetry - run: pip install poetry - - - name: Install package - run: poetry install - - - name: Run unit tests - run: poetry run python3 -m unittest \ No newline at end of file From c89a519b8509982f40b5ce5c16d04fde5f8249e4 Mon Sep 17 00:00:00 2001 From: cfernhout Date: Fri, 13 May 2022 14:37:16 +0200 Subject: [PATCH 06/16] [DAT-3282] Change name workflow --- .github/workflows/ci.yml | 44 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..c86bf88b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,44 @@ +name: CI + +on: + push: + paths: + - '**.py' + - '.github/workflows/**' + - '!dev/**' + pull_request: + branches: [ master ] + + workflow_dispatch: + +jobs: + unit_tests: + runs-on: ubuntu-latest + strategy: + max-parallel: 2 + fail-fast: false + matrix: + python-version: + - "3.7" + - "3.10" + + name: Check Python ${{ matrix.python-version }} + steps: + - uses: actions/checkout@v3 + + - name: Setup Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + + - name: Build the stack + run: docker-compose up -d mysql + + - name: Install Poetry + run: pip install poetry + + - name: Install package + run: poetry install + + - name: Run unit tests + run: poetry run python3 -m unittest \ No newline at end of file From bd7f32d7267faa3ebdba8433c7d5ca1c2b60bd90 Mon Sep 17 00:00:00 2001 From: cfernhout Date: Fri, 13 May 2022 15:24:18 +0200 Subject: [PATCH 07/16] [DAT-3282] Add more Python versions and OS's in CI --- .github/workflows/ci.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c86bf88b..a49b722c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,16 +13,19 @@ on: jobs: unit_tests: - runs-on: ubuntu-latest strategy: - max-parallel: 2 + max-parallel: 4 fail-fast: false matrix: + os: [ubuntu-latest, windows-latest, macos-latest] python-version: - "3.7" + - "3.8" + - "3.9" - "3.10" - name: Check Python ${{ matrix.python-version }} + name: Check Python ${{ matrix.python-version }} on ${{ matrix.os }} + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 From 7b3bb67a691246b12fe210d84cddaa6d68944f33 Mon Sep 17 00:00:00 2001 From: cfernhout Date: Fri, 13 May 2022 15:40:57 +0200 Subject: [PATCH 08/16] [DAT-3282] Remove Windows for now and install docker-compose for MacOS --- .github/workflows/ci.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a49b722c..517190f0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,10 +14,9 @@ on: jobs: unit_tests: strategy: - max-parallel: 4 fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] + os: [ubuntu-latest, macos-latest] python-version: - "3.7" - "3.8" @@ -34,6 +33,10 @@ jobs: with: python-version: ${{ matrix.python-version }} + - name: Install docker-compose + run: brew install docker-compose + if: ${{ startsWith(${{ matrix.os }}, 'macos') }} + - name: Build the stack run: docker-compose up -d mysql From 20adf79614a279c47134a32f9a96fb4e2a12a56d Mon Sep 17 00:00:00 2001 From: cfernhout Date: Fri, 13 May 2022 15:43:42 +0200 Subject: [PATCH 09/16] [DAT-3282] Fix conditional step --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 517190f0..d07ae0e5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,7 +35,7 @@ jobs: - name: Install docker-compose run: brew install docker-compose - if: ${{ startsWith(${{ matrix.os }}, 'macos') }} + if: ${{ startsWith(matrix.os, 'macos') }} - name: Build the stack run: docker-compose up -d mysql From 29219099796660e4ad0310eaa8e364b3c4aec321 Mon Sep 17 00:00:00 2001 From: cfernhout Date: Fri, 13 May 2022 15:52:56 +0200 Subject: [PATCH 10/16] [DAT-3282] Add additional docker installs --- .github/workflows/ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d07ae0e5..992e2d49 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,8 +33,10 @@ jobs: with: python-version: ${{ matrix.python-version }} - - name: Install docker-compose - run: brew install docker-compose + - name: Install Docker + run: | + brew install docker-machine docker + brew install docker-compose if: ${{ startsWith(matrix.os, 'macos') }} - name: Build the stack From 54971539c5b36a7811373971de4bc343d8013fab Mon Sep 17 00:00:00 2001 From: cfernhout Date: Fri, 13 May 2022 15:54:52 +0200 Subject: [PATCH 11/16] [DAT-3282] Start Docker in CI --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 992e2d49..76f99598 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,10 +33,11 @@ jobs: with: python-version: ${{ matrix.python-version }} - - name: Install Docker + - name: Install and start Docker run: | brew install docker-machine docker brew install docker-compose + open -a Docker if: ${{ startsWith(matrix.os, 'macos') }} - name: Build the stack From d162c4b5b6cd9954647a57e56803eea02203e232 Mon Sep 17 00:00:00 2001 From: cfernhout Date: Fri, 13 May 2022 15:57:32 +0200 Subject: [PATCH 12/16] [DAT-3282] Change starting of Docker in CI --- .github/workflows/ci.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 76f99598..5bdd0a0c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,9 +35,8 @@ jobs: - name: Install and start Docker run: | - brew install docker-machine docker - brew install docker-compose - open -a Docker + brew install docker-machine docker docker-compose + sudo docker –version if: ${{ startsWith(matrix.os, 'macos') }} - name: Build the stack From 1ffc630d39db90a72d6c9e6e4cbec8cdd65a4ad7 Mon Sep 17 00:00:00 2001 From: cfernhout Date: Fri, 13 May 2022 15:59:55 +0200 Subject: [PATCH 13/16] [DAT-3282] Fix typo --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5bdd0a0c..dcc4caa4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,7 +36,7 @@ jobs: - name: Install and start Docker run: | brew install docker-machine docker docker-compose - sudo docker –version + sudo docker -–version if: ${{ startsWith(matrix.os, 'macos') }} - name: Build the stack From a4c645c876e1489d66b42f11805a9972158450b0 Mon Sep 17 00:00:00 2001 From: cfernhout Date: Fri, 13 May 2022 16:02:09 +0200 Subject: [PATCH 14/16] [DAT-3282] Change --version into -v because of weird error --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dcc4caa4..c01f334f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,7 +36,7 @@ jobs: - name: Install and start Docker run: | brew install docker-machine docker docker-compose - sudo docker -–version + sudo docker -v if: ${{ startsWith(matrix.os, 'macos') }} - name: Build the stack From 1dc3ae3b61e2a7215e66a6ab27b492bda067e40a Mon Sep 17 00:00:00 2001 From: cfernhout Date: Fri, 13 May 2022 16:05:00 +0200 Subject: [PATCH 15/16] [DAT-3282] Change starting of Docker in CI --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c01f334f..a0de48b7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,7 +36,7 @@ jobs: - name: Install and start Docker run: | brew install docker-machine docker docker-compose - sudo docker -v + docker-machine start if: ${{ startsWith(matrix.os, 'macos') }} - name: Build the stack From 4ca28a9a76a57355b212e413e602b8a0939eb781 Mon Sep 17 00:00:00 2001 From: cfernhout Date: Fri, 13 May 2022 16:11:41 +0200 Subject: [PATCH 16/16] [DAT-3282] Remove MacOS from CI --- .github/workflows/ci.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a0de48b7..c16bd496 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest] + os: [ubuntu-latest] python-version: - "3.7" - "3.8" @@ -33,12 +33,6 @@ jobs: with: python-version: ${{ matrix.python-version }} - - name: Install and start Docker - run: | - brew install docker-machine docker docker-compose - docker-machine start - if: ${{ startsWith(matrix.os, 'macos') }} - - name: Build the stack run: docker-compose up -d mysql