From 8aece8928472a55b97443a565a1abce1100642b0 Mon Sep 17 00:00:00 2001 From: Lucas Harms Date: Thu, 2 Dec 2021 12:13:56 -0600 Subject: [PATCH 01/62] test gha docker setup --- .github/workflows/build-and-release.yaml | 46 ++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/build-and-release.yaml diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml new file mode 100644 index 000000000..1f4545baa --- /dev/null +++ b/.github/workflows/build-and-release.yaml @@ -0,0 +1,46 @@ +name: Build and Release + +on: [push] + +env: + DOCKERHUB_USERNAME: ${{ secrets.DOCKER_USERNAME }} + +jobs: + build: + runs-on: ubuntu-20.04 + + strategy: + matrix: + include: + - arch: "amd64" + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Get Short SHA + id: vars + run: | + echo ::set-output name=sha_short::${GITHUB_SHA::16} + shell: bash + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker context for Buildx + id: buildx-context + run: | + docker context create container-builder + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + with: + version: latest + endpoint: container-builder + + - name: Login to DockerHub + if: ${{ github.ref == 'master' && github.event.pull_request.merged == true }} + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} \ No newline at end of file From 76ef3fbc21ffa6ebf5725f465b0de641b1d933a7 Mon Sep 17 00:00:00 2001 From: Lucas Harms Date: Thu, 2 Dec 2021 12:14:56 -0600 Subject: [PATCH 02/62] test gha docker login --- .github/workflows/build-and-release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index 1f4545baa..684c1d2df 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -39,7 +39,7 @@ jobs: endpoint: container-builder - name: Login to DockerHub - if: ${{ github.ref == 'master' && github.event.pull_request.merged == true }} + # if: ${{ github.ref == 'master' && github.event.pull_request.merged == true }} uses: docker/login-action@v1 with: username: ${{ secrets.DOCKER_USERNAME }} From c120dbb6835fec240de4fe5494e5fe5943f28aa5 Mon Sep 17 00:00:00 2001 From: Lucas Harms Date: Thu, 2 Dec 2021 13:56:44 -0600 Subject: [PATCH 03/62] test buildx --- .github/workflows/build-and-release.yaml | 33 ++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index 684c1d2df..c48df1ab6 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -4,6 +4,9 @@ on: [push] env: DOCKERHUB_USERNAME: ${{ secrets.DOCKER_USERNAME }} + PROJECT: sync-engine + # TODO: Remove this after migration + TAG_SUFFIX: "-gha" jobs: build: @@ -12,7 +15,21 @@ jobs: strategy: matrix: include: - - arch: "amd64" + - build_name: py2.7 + python_version: "2.7" + push: true + - build_name: py3.6 + python_version: "3.6" + push: true + - build_name: py3.7 + python_version: "3.7" + push: false + - build_name: py3.8 + python_version: "3.8" + push: false + - build_name: py3.9 + python_version: "3.9" + push: false steps: - name: Checkout @@ -43,4 +60,16 @@ jobs: uses: docker/login-action@v1 with: username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} \ No newline at end of file + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build and Push containers + uses: docker/build-push-action@v2 + with: + platforms: linux/amd64,linux/arm64 + push: ${{ matrix.push }} + build-args: + PYTHON_VERSION=${{ matrix.python_version }} + tags: | + ${{ DOCKERHUB_USERNAME }}/${{ env.PROJECT }}:${{ SHA_SHORT }}-${{ matrix.build_name}}${{ env.TAG_SUFFIX }} + cache-from: type=gha + cache-to: type=gha,mode=max \ No newline at end of file From 0ecd4ca5d3d754b70d44f0de17a0d064be2b601d Mon Sep 17 00:00:00 2001 From: Lucas Harms Date: Thu, 2 Dec 2021 13:59:44 -0600 Subject: [PATCH 04/62] fix variable names --- .github/workflows/build-and-release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index c48df1ab6..6d06b833a 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -70,6 +70,6 @@ jobs: build-args: PYTHON_VERSION=${{ matrix.python_version }} tags: | - ${{ DOCKERHUB_USERNAME }}/${{ env.PROJECT }}:${{ SHA_SHORT }}-${{ matrix.build_name}}${{ env.TAG_SUFFIX }} + ${{ env.DOCKERHUB_USERNAME }}/${{ env.PROJECT }}:${{ steps.vars.outputs.sha_short }}-${{ matrix.build_name}}${{ env.TAG_SUFFIX }} cache-from: type=gha cache-to: type=gha,mode=max \ No newline at end of file From d80e85813c3892d6f5da51a48a5e49ab839e9a14 Mon Sep 17 00:00:00 2001 From: Lucas Harms Date: Thu, 2 Dec 2021 14:05:28 -0600 Subject: [PATCH 05/62] test buildx --- .github/workflows/build-and-release.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index 6d06b833a..ddafc90f0 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -66,7 +66,8 @@ jobs: uses: docker/build-push-action@v2 with: platforms: linux/amd64,linux/arm64 - push: ${{ matrix.push }} + # push: ${{ matrix.push }} + push: false build-args: PYTHON_VERSION=${{ matrix.python_version }} tags: | From e92f577aca0fe30ced42cc2ea305d78ad4c5d0b0 Mon Sep 17 00:00:00 2001 From: Lucas Harms Date: Thu, 2 Dec 2021 15:58:17 -0600 Subject: [PATCH 06/62] test cache --- .github/workflows/build-and-release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index ddafc90f0..2979bd5b8 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -73,4 +73,4 @@ jobs: tags: | ${{ env.DOCKERHUB_USERNAME }}/${{ env.PROJECT }}:${{ steps.vars.outputs.sha_short }}-${{ matrix.build_name}}${{ env.TAG_SUFFIX }} cache-from: type=gha - cache-to: type=gha,mode=max \ No newline at end of file + cache-to: type=gha,mode=max From cb4960a92545bea5e9162275614db4b0e2aea9d0 Mon Sep 17 00:00:00 2001 From: Lucas Harms Date: Thu, 2 Dec 2021 17:56:44 -0600 Subject: [PATCH 07/62] amd64 only with gha cache --- .github/workflows/build-and-release.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index 2979bd5b8..d63191a2c 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -65,7 +65,8 @@ jobs: - name: Build and Push containers uses: docker/build-push-action@v2 with: - platforms: linux/amd64,linux/arm64 + # platforms: linux/amd64,linux/arm64 + platforms: linux/amd64 # push: ${{ matrix.push }} push: false build-args: From 8c077007f69c73399e968232583bee75e44f4dc0 Mon Sep 17 00:00:00 2001 From: Lucas Harms Date: Thu, 2 Dec 2021 18:02:53 -0600 Subject: [PATCH 08/62] Adjust docker layers --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 655b82088..8a48c960e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -52,7 +52,7 @@ WORKDIR /opt/app ENV PATH="/opt/venv/bin:$PATH" -COPY --chown=sync-engine:sync-engine ./ ./ +COPY --chown=sync-engine:sync-engine ./requirements/ ./requirments/ RUN python3 -m pip install pip==23.3.1 virtualenv==20.17.1 && \ python3 -m virtualenv /opt/venv && \ /opt/venv/bin/python3 -m pip install setuptools==67.4.0 && \ @@ -60,6 +60,8 @@ RUN python3 -m pip install pip==23.3.1 virtualenv==20.17.1 && \ /opt/venv/bin/python3 -m pip install -e . && \ /opt/venv/bin/python3 -m pip check +COPY --chown=sync-engine:sync-engine ./ ./ + RUN ln -s /opt/app/bin/wait-for-it.sh /opt/venv/bin/ ENV \ From 004a020eb9421675e01cb21a4fe0aeb0d265e685 Mon Sep 17 00:00:00 2001 From: Lucas Harms Date: Thu, 2 Dec 2021 18:07:18 -0600 Subject: [PATCH 09/62] Adjust docker layers --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 8a48c960e..c2bd705b7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -52,7 +52,7 @@ WORKDIR /opt/app ENV PATH="/opt/venv/bin:$PATH" -COPY --chown=sync-engine:sync-engine ./requirements/ ./requirments/ +COPY --chown=sync-engine:sync-engine ./requirements/ ./requirements/ RUN python3 -m pip install pip==23.3.1 virtualenv==20.17.1 && \ python3 -m virtualenv /opt/venv && \ /opt/venv/bin/python3 -m pip install setuptools==67.4.0 && \ From 69376305ea5a66aeb38a0be8bfa75a1b33d8f574 Mon Sep 17 00:00:00 2001 From: Lucas Harms Date: Thu, 2 Dec 2021 18:10:47 -0600 Subject: [PATCH 10/62] Adjust docker layers --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index c2bd705b7..c318e5f01 100644 --- a/Dockerfile +++ b/Dockerfile @@ -52,7 +52,7 @@ WORKDIR /opt/app ENV PATH="/opt/venv/bin:$PATH" -COPY --chown=sync-engine:sync-engine ./requirements/ ./requirements/ +COPY --chown=sync-engine:sync-engine ./requirements ./requirements RUN python3 -m pip install pip==23.3.1 virtualenv==20.17.1 && \ python3 -m virtualenv /opt/venv && \ /opt/venv/bin/python3 -m pip install setuptools==67.4.0 && \ From cd8c81224696aa356c559c56fbdcdd61818b74e8 Mon Sep 17 00:00:00 2001 From: Lucas Harms Date: Fri, 3 Dec 2021 08:48:30 -0600 Subject: [PATCH 11/62] add workflow concurrency --- .github/workflows/build-and-release.yaml | 6 +++++- Dockerfile | 4 +--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index d63191a2c..b0202af93 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -2,6 +2,10 @@ name: Build and Release on: [push] +concurrency: + group: ${{ github.head_ref }} + cancel-in-progress: true + env: DOCKERHUB_USERNAME: ${{ secrets.DOCKER_USERNAME }} PROJECT: sync-engine @@ -67,7 +71,7 @@ jobs: with: # platforms: linux/amd64,linux/arm64 platforms: linux/amd64 - # push: ${{ matrix.push }} + push: ${{ matrix.push }} push: false build-args: PYTHON_VERSION=${{ matrix.python_version }} diff --git a/Dockerfile b/Dockerfile index c318e5f01..655b82088 100644 --- a/Dockerfile +++ b/Dockerfile @@ -52,7 +52,7 @@ WORKDIR /opt/app ENV PATH="/opt/venv/bin:$PATH" -COPY --chown=sync-engine:sync-engine ./requirements ./requirements +COPY --chown=sync-engine:sync-engine ./ ./ RUN python3 -m pip install pip==23.3.1 virtualenv==20.17.1 && \ python3 -m virtualenv /opt/venv && \ /opt/venv/bin/python3 -m pip install setuptools==67.4.0 && \ @@ -60,8 +60,6 @@ RUN python3 -m pip install pip==23.3.1 virtualenv==20.17.1 && \ /opt/venv/bin/python3 -m pip install -e . && \ /opt/venv/bin/python3 -m pip check -COPY --chown=sync-engine:sync-engine ./ ./ - RUN ln -s /opt/app/bin/wait-for-it.sh /opt/venv/bin/ ENV \ From 1873f4ae9c827258777e115928eed874b403f826 Mon Sep 17 00:00:00 2001 From: Lucas Harms Date: Fri, 3 Dec 2021 09:28:05 -0600 Subject: [PATCH 12/62] Adds static code job --- .github/workflows/build-and-release.yaml | 45 +++++++++++++++++++----- 1 file changed, 36 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index b0202af93..aa791223c 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -13,27 +13,56 @@ env: TAG_SUFFIX: "-gha" jobs: - build: + static-code-analysis: runs-on: ubuntu-20.04 + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: '3.7' + architecture: 'x64' + + - name: Run Black + run: black --check . + + - name: Run isort + run: isort -c . + + - name: Run flake8 + run: flake8 + + + build-amd64: + runs-on: + - ubuntu-20.04 + - x64 strategy: matrix: include: - build_name: py2.7 + dockerhub_push: true python_version: "2.7" - push: true + run_tests: true - build_name: py3.6 + dockerhub_push: true python_version: "3.6" - push: true + run_tests: true - build_name: py3.7 + dockerhub_push: false python_version: "3.7" - push: false + run_tests: true - build_name: py3.8 + dockerhub_push: true python_version: "3.8" - push: false + run_tests: true - build_name: py3.9 + dockerhub_push: false python_version: "3.9" - push: false + run_tests: true steps: - name: Checkout @@ -69,10 +98,8 @@ jobs: - name: Build and Push containers uses: docker/build-push-action@v2 with: - # platforms: linux/amd64,linux/arm64 platforms: linux/amd64 - push: ${{ matrix.push }} - push: false + push: ${{ matrix.dockerhub_push }} build-args: PYTHON_VERSION=${{ matrix.python_version }} tags: | From 5402bfd4ecc111d3d8facc36238482f5ccbad148 Mon Sep 17 00:00:00 2001 From: Lucas Harms Date: Fri, 3 Dec 2021 09:33:48 -0600 Subject: [PATCH 13/62] change concurrency --- .github/workflows/build-and-release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index aa791223c..8ab0ee275 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -3,7 +3,7 @@ name: Build and Release on: [push] concurrency: - group: ${{ github.head_ref }} + group: ${{ github.ref }} cancel-in-progress: true env: From 23597387f9c4a11a54e36d028df2e81b6a414371 Mon Sep 17 00:00:00 2001 From: Lucas Harms Date: Fri, 3 Dec 2021 09:48:39 -0600 Subject: [PATCH 14/62] Why is this a yaml error? --- .github/workflows/build-and-release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index 8ab0ee275..52955884a 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -2,7 +2,7 @@ name: Build and Release on: [push] -concurrency: +concurrency: group: ${{ github.ref }} cancel-in-progress: true From f7c355f9a225355ce6972c7f52ff0baafb52b9d3 Mon Sep 17 00:00:00 2001 From: Lucas Harms Date: Fri, 3 Dec 2021 09:50:47 -0600 Subject: [PATCH 15/62] add lint install --- .github/workflows/build-and-release.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index 52955884a..c034fc3c9 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -25,6 +25,9 @@ jobs: python-version: '3.7' architecture: 'x64' + - name: Prepare lint requirements + run: python -m pip install --no-deps -r requirements.lint.txt + - name: Run Black run: black --check . From 497de9bf71eeefea89a77b7d3db0afd3014cd79c Mon Sep 17 00:00:00 2001 From: Lucas Harms Date: Fri, 3 Dec 2021 09:51:24 -0600 Subject: [PATCH 16/62] Why is this a yaml error? --- .github/workflows/build-and-release.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index c034fc3c9..f3d1e1c9d 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -2,7 +2,7 @@ name: Build and Release on: [push] -concurrency: +concurrency: group: ${{ github.ref }} cancel-in-progress: true @@ -27,7 +27,7 @@ jobs: - name: Prepare lint requirements run: python -m pip install --no-deps -r requirements.lint.txt - + - name: Run Black run: black --check . From f238ed2cde4e5ac51d0fa94b3cf749ee2cacf75c Mon Sep 17 00:00:00 2001 From: Lucas Harms Date: Fri, 3 Dec 2021 09:57:29 -0600 Subject: [PATCH 17/62] really? --- .github/workflows/build-and-release.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index f3d1e1c9d..f43e75bcd 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -39,9 +39,7 @@ jobs: build-amd64: - runs-on: - - ubuntu-20.04 - - x64 + runs-on: ubuntu-20.04 strategy: matrix: From 18b601b4f919c98ac373a61522246f58514c701b Mon Sep 17 00:00:00 2001 From: Lucas Harms Date: Fri, 3 Dec 2021 09:58:33 -0600 Subject: [PATCH 18/62] maybe? --- .github/workflows/build-and-release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index f43e75bcd..0615f0931 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -3,7 +3,7 @@ name: Build and Release on: [push] concurrency: - group: ${{ github.ref }} + group: ${{ github.ref_name }} cancel-in-progress: true env: From d7703b6f636b6decf8eef94e83d6da8e6717ddb0 Mon Sep 17 00:00:00 2001 From: Lucas Harms Date: Fri, 3 Dec 2021 10:01:57 -0600 Subject: [PATCH 19/62] maybe? --- .github/workflows/build-and-release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index 0615f0931..4175eee5e 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -3,7 +3,7 @@ name: Build and Release on: [push] concurrency: - group: ${{ github.ref_name }} + group: ${{ github.workflow }} cancel-in-progress: true env: From ad6c244a09f11e8f47e8bb01735648382b08f0c6 Mon Sep 17 00:00:00 2001 From: Lucas Harms Date: Fri, 3 Dec 2021 10:39:32 -0600 Subject: [PATCH 20/62] maybe? --- .github/workflows/build-and-release.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index 4175eee5e..7ba752e55 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -2,10 +2,6 @@ name: Build and Release on: [push] -concurrency: - group: ${{ github.workflow }} - cancel-in-progress: true - env: DOCKERHUB_USERNAME: ${{ secrets.DOCKER_USERNAME }} PROJECT: sync-engine @@ -25,8 +21,10 @@ jobs: python-version: '3.7' architecture: 'x64' - - name: Prepare lint requirements - run: python -m pip install --no-deps -r requirements.lint.txt + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install --no-deps -r requirements.lint.txt - name: Run Black run: black --check . @@ -40,7 +38,9 @@ jobs: build-amd64: runs-on: ubuntu-20.04 - + concurrency: + group: ${{ github.ref_name }} + cancel-in-progress: true strategy: matrix: include: From 347dd84f2390207a16c36351c0a1cc900e8fd8cc Mon Sep 17 00:00:00 2001 From: Lucas Harms Date: Fri, 3 Dec 2021 10:40:20 -0600 Subject: [PATCH 21/62] maybe? --- .github/workflows/build-and-release.yaml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index 7ba752e55..018834e9d 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -2,6 +2,10 @@ name: Build and Release on: [push] +concurrency: + group: build-${{ github.ref_name }} + cancel-in-progress: true + env: DOCKERHUB_USERNAME: ${{ secrets.DOCKER_USERNAME }} PROJECT: sync-engine @@ -38,9 +42,7 @@ jobs: build-amd64: runs-on: ubuntu-20.04 - concurrency: - group: ${{ github.ref_name }} - cancel-in-progress: true + strategy: matrix: include: From 23eb178d5c2b13203aaa2cb31898845ce5412fde Mon Sep 17 00:00:00 2001 From: Lucas Harms Date: Fri, 3 Dec 2021 10:40:56 -0600 Subject: [PATCH 22/62] maybe? --- .github/workflows/build-and-release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index 018834e9d..60483eb07 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -3,7 +3,7 @@ name: Build and Release on: [push] concurrency: - group: build-${{ github.ref_name }} + group: build cancel-in-progress: true env: From c42b1eead11a5501ea55d6d7dee8bb1a13362f8d Mon Sep 17 00:00:00 2001 From: Lucas Harms Date: Fri, 3 Dec 2021 10:47:32 -0600 Subject: [PATCH 23/62] maybe? --- .github/workflows/build-and-release.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index 60483eb07..e869d7201 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -2,9 +2,9 @@ name: Build and Release on: [push] -concurrency: - group: build - cancel-in-progress: true +concurrency: build-and-release + # group: build-${{ github.ref_name }} + # cancel-in-progress: true env: DOCKERHUB_USERNAME: ${{ secrets.DOCKER_USERNAME }} From 53db67f8da6153afdc782c4d38e03350b83916a3 Mon Sep 17 00:00:00 2001 From: Lucas Harms Date: Fri, 3 Dec 2021 10:48:45 -0600 Subject: [PATCH 24/62] maybe? --- .github/workflows/build-and-release.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index e869d7201..ad0e0d08b 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -2,8 +2,8 @@ name: Build and Release on: [push] -concurrency: build-and-release - # group: build-${{ github.ref_name }} +concurrency: + group: "build-and-release-${{ github.ref_name }}" # cancel-in-progress: true env: From 648d6ea7e0ef6801e7ac9b560f86aca1f2b7e063 Mon Sep 17 00:00:00 2001 From: Lucas Harms Date: Fri, 3 Dec 2021 10:50:16 -0600 Subject: [PATCH 25/62] maybe? --- .github/workflows/build-and-release.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index ad0e0d08b..3aeb4777f 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -2,10 +2,6 @@ name: Build and Release on: [push] -concurrency: - group: "build-and-release-${{ github.ref_name }}" - # cancel-in-progress: true - env: DOCKERHUB_USERNAME: ${{ secrets.DOCKER_USERNAME }} PROJECT: sync-engine @@ -41,6 +37,10 @@ jobs: build-amd64: + concurrency: + group: "build-and-release-${{ github.ref_name }}" + cancel-in-progress: true + runs-on: ubuntu-20.04 strategy: From 4c4461b9398b97f176d2cebeb12367c6d30b2fe3 Mon Sep 17 00:00:00 2001 From: Lucas Harms Date: Fri, 3 Dec 2021 10:50:48 -0600 Subject: [PATCH 26/62] maybe? --- .github/workflows/build-and-release.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index 3aeb4777f..a642e24db 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -38,7 +38,8 @@ jobs: build-amd64: concurrency: - group: "build-and-release-${{ github.ref_name }}" + group: "build-and-release" + # group: "build-and-release-${{ github.ref_name }}" cancel-in-progress: true runs-on: ubuntu-20.04 From 3c7a27a867b125d8c411fd3b4b135e4d5b72488d Mon Sep 17 00:00:00 2001 From: Lucas Harms Date: Fri, 3 Dec 2021 11:03:19 -0600 Subject: [PATCH 27/62] maybe? --- .github/workflows/build-and-release.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index a642e24db..ba5404e9b 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -38,8 +38,7 @@ jobs: build-amd64: concurrency: - group: "build-and-release" - # group: "build-and-release-${{ github.ref_name }}" + group: build-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true runs-on: ubuntu-20.04 From 43700b492ee5c2f141dc6c3a00b8d7d371379ea1 Mon Sep 17 00:00:00 2001 From: Lucas Harms Date: Fri, 3 Dec 2021 11:35:25 -0600 Subject: [PATCH 28/62] maybe? --- .github/workflows/build-and-release.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index ba5404e9b..b4a164010 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -1,6 +1,9 @@ name: Build and Release -on: [push] +on: + push: + branches: + - '*' env: DOCKERHUB_USERNAME: ${{ secrets.DOCKER_USERNAME }} From 81aef3b27edb7f10e622e4729fdc466b847b669d Mon Sep 17 00:00:00 2001 From: Lucas Harms Date: Fri, 3 Dec 2021 11:37:10 -0600 Subject: [PATCH 29/62] lame. you have to have branches in the push for concurrency to work --- .github/workflows/build-and-release.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index b4a164010..64b7920ac 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -5,6 +5,10 @@ on: branches: - '*' + concurrency: + group: build-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + env: DOCKERHUB_USERNAME: ${{ secrets.DOCKER_USERNAME }} PROJECT: sync-engine @@ -40,10 +44,6 @@ jobs: build-amd64: - concurrency: - group: build-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - runs-on: ubuntu-20.04 strategy: From b4b36daf3250d968548b8b496f945cdea2a3d611 Mon Sep 17 00:00:00 2001 From: Lucas Harms Date: Fri, 3 Dec 2021 11:37:56 -0600 Subject: [PATCH 30/62] lame. you have to have branches in the push for concurrency to work --- .github/workflows/build-and-release.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index 64b7920ac..4ce94a2fa 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -5,10 +5,10 @@ on: branches: - '*' - concurrency: - group: build-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - +concurrency: + group: build-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + env: DOCKERHUB_USERNAME: ${{ secrets.DOCKER_USERNAME }} PROJECT: sync-engine From 71e42481a3a30f3bd9ee162c8ba4ea1b3504757c Mon Sep 17 00:00:00 2001 From: Lucas Harms Date: Fri, 3 Dec 2021 11:44:43 -0600 Subject: [PATCH 31/62] / --- .github/workflows/build-and-release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index 4ce94a2fa..ca1d580ca 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -31,7 +31,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install --no-deps -r requirements.lint.txt + python -m pip install --no-deps -r requirements/lint.txt - name: Run Black run: black --check . From d3843167a9bb61e063f983993ebafca0a7c0594b Mon Sep 17 00:00:00 2001 From: Lucas Harms Date: Fri, 3 Dec 2021 15:04:15 -0600 Subject: [PATCH 32/62] how is zipp missing? --- .github/workflows/build-and-release.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index ca1d580ca..2d542bbb6 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -30,7 +30,8 @@ jobs: - name: Install dependencies run: | - python -m pip install --upgrade pip + python -m pip install --upgrade pip + python -m pip install zipp python -m pip install --no-deps -r requirements/lint.txt - name: Run Black From 494f785be229bd59d2d243f09721de3e2d0f9067 Mon Sep 17 00:00:00 2001 From: Lucas Harms Date: Fri, 3 Dec 2021 15:09:29 -0600 Subject: [PATCH 33/62] install static deps --- .github/workflows/build-and-release.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index 2d542bbb6..ed74dab75 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -31,8 +31,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install zipp - python -m pip install --no-deps -r requirements/lint.txt + python -m pip install -r requirements/lint.txt - name: Run Black run: black --check . From 5a0acfb7d2682558c232245c5561db903081281b Mon Sep 17 00:00:00 2001 From: Lucas Harms Date: Fri, 3 Dec 2021 15:52:46 -0600 Subject: [PATCH 34/62] Adds tests --- .github/workflows/build-and-release.yaml | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index ed74dab75..dc33cb123 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -74,10 +74,13 @@ jobs: - name: Checkout uses: actions/checkout@v2 - - name: Get Short SHA + - name: Prepare environment id: vars run: | echo ::set-output name=sha_short::${GITHUB_SHA::16} + if [ "$(git log -1 --pretty=%B | head -n 1 | grep '#notests')" ]; then + echo 'SKIP_TESTS="1"' >> $GITHUB_ENV + fi shell: bash - name: Set up QEMU @@ -101,7 +104,7 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - - name: Build and Push containers + - name: Build and push sync-engine images uses: docker/build-push-action@v2 with: platforms: linux/amd64 @@ -112,3 +115,18 @@ jobs: ${{ env.DOCKERHUB_USERNAME }}/${{ env.PROJECT }}:${{ steps.vars.outputs.sha_short }}-${{ matrix.build_name}}${{ env.TAG_SUFFIX }} cache-from: type=gha cache-to: type=gha,mode=max + + - name: Run tests + if: ${{ matrix.run_tests }} + run: | + if [[ -z $SKIP_TESTS ]]; then + docker-compose run \ + ${{ env.DOCKERHUB_USERNAME }}/${{ env.PROJECT }}:${{ steps.vars.outputs.sha_short }}-${{ matrix.build_name}}${{ env.TAG_SUFFIX }} \ + bash -ec ' + bin/wait-for-it.sh mysql:3306 \ + && NYLAS_ENV=test pytest --cov-report= --cov=inbox tests/ \ + && coverage html -d pythoncov + ' + else + echo Skipping tests + fi \ No newline at end of file From 510155a2b3dde86ae1d173ee802b2b0188f91968 Mon Sep 17 00:00:00 2001 From: Lucas Harms Date: Fri, 3 Dec 2021 16:00:07 -0600 Subject: [PATCH 35/62] Fix hub namespace --- .github/workflows/build-and-release.yaml | 25 ++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index dc33cb123..2d6b6211b 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -10,7 +10,7 @@ concurrency: cancel-in-progress: true env: - DOCKERHUB_USERNAME: ${{ secrets.DOCKER_USERNAME }} + DOCKERHUB_NAMESPACE: closeio PROJECT: sync-engine # TODO: Remove this after migration TAG_SUFFIX: "-gha" @@ -49,23 +49,28 @@ jobs: strategy: matrix: include: - - build_name: py2.7 + - arch: amd64 + build_name: py2.7 dockerhub_push: true python_version: "2.7" run_tests: true - - build_name: py3.6 + - arch: amd64 + build_name: py3.6 dockerhub_push: true python_version: "3.6" run_tests: true - - build_name: py3.7 + - arch: amd64 + build_name: py3.7 dockerhub_push: false python_version: "3.7" run_tests: true - - build_name: py3.8 + - arch: amd64 + build_name: py3.8 dockerhub_push: true python_version: "3.8" run_tests: true - - build_name: py3.9 + - arch: amd64 + build_name: py3.9 dockerhub_push: false python_version: "3.9" run_tests: true @@ -107,12 +112,12 @@ jobs: - name: Build and push sync-engine images uses: docker/build-push-action@v2 with: - platforms: linux/amd64 + platforms: linux/${{ matrix.arch }} push: ${{ matrix.dockerhub_push }} build-args: PYTHON_VERSION=${{ matrix.python_version }} tags: | - ${{ env.DOCKERHUB_USERNAME }}/${{ env.PROJECT }}:${{ steps.vars.outputs.sha_short }}-${{ matrix.build_name}}${{ env.TAG_SUFFIX }} + ${{ env.DOCKERHUB_NAMESPACE }}/${{ env.PROJECT }}:${{ steps.vars.outputs.sha_short }}-${{ matrix.build_name}}${{ env.TAG_SUFFIX }}-${{ matric.arch }} cache-from: type=gha cache-to: type=gha,mode=max @@ -121,7 +126,7 @@ jobs: run: | if [[ -z $SKIP_TESTS ]]; then docker-compose run \ - ${{ env.DOCKERHUB_USERNAME }}/${{ env.PROJECT }}:${{ steps.vars.outputs.sha_short }}-${{ matrix.build_name}}${{ env.TAG_SUFFIX }} \ + ${{ env.DOCKERHUB_NAMESPACE }}/${{ env.PROJECT }}:${{ steps.vars.outputs.sha_short }}-${{ matrix.build_name}}${{ env.TAG_SUFFIX }}-${{ matric.arch }} \ bash -ec ' bin/wait-for-it.sh mysql:3306 \ && NYLAS_ENV=test pytest --cov-report= --cov=inbox tests/ \ @@ -129,4 +134,4 @@ jobs: ' else echo Skipping tests - fi \ No newline at end of file + fi From 6e2516ccc43a557e83e2c4a166b22ba871a3a893 Mon Sep 17 00:00:00 2001 From: Lucas Harms Date: Fri, 3 Dec 2021 16:37:09 -0600 Subject: [PATCH 36/62] Refactor tags --- .github/workflows/build-and-release.yaml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index 2d6b6211b..c67316dd1 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -86,6 +86,7 @@ jobs: if [ "$(git log -1 --pretty=%B | head -n 1 | grep '#notests')" ]; then echo 'SKIP_TESTS="1"' >> $GITHUB_ENV fi + echo DOCKER_IMAGE_TAG=${{ env.DOCKERHUB_NAMESPACE }}/${{ env.PROJECT }}:${{ steps.vars.outputs.sha_short }}-${{ matrix.build_name}}${{ env.TAG_SUFFIX }}-${{ matrix.arch }} >> $GITHUB_ENV shell: bash - name: Set up QEMU @@ -117,17 +118,19 @@ jobs: build-args: PYTHON_VERSION=${{ matrix.python_version }} tags: | - ${{ env.DOCKERHUB_NAMESPACE }}/${{ env.PROJECT }}:${{ steps.vars.outputs.sha_short }}-${{ matrix.build_name}}${{ env.TAG_SUFFIX }}-${{ matric.arch }} + ${{ DOCKER_IMAGE_TAG }} cache-from: type=gha cache-to: type=gha,mode=max + - name: Retag container for tests + run: | + docker tag ${{ DOCKER_IMAGE_TAG }} ${{ env.PROJECT }}_app + - name: Run tests if: ${{ matrix.run_tests }} run: | if [[ -z $SKIP_TESTS ]]; then - docker-compose run \ - ${{ env.DOCKERHUB_NAMESPACE }}/${{ env.PROJECT }}:${{ steps.vars.outputs.sha_short }}-${{ matrix.build_name}}${{ env.TAG_SUFFIX }}-${{ matric.arch }} \ - bash -ec ' + docker-compose run app bash -ec ' bin/wait-for-it.sh mysql:3306 \ && NYLAS_ENV=test pytest --cov-report= --cov=inbox tests/ \ && coverage html -d pythoncov From 06f20385c3fe68065c4fe83f45d35a8ee910f546 Mon Sep 17 00:00:00 2001 From: Lucas Harms Date: Fri, 3 Dec 2021 16:40:14 -0600 Subject: [PATCH 37/62] so picky --- .github/workflows/build-and-release.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index c67316dd1..622b19bde 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -118,13 +118,13 @@ jobs: build-args: PYTHON_VERSION=${{ matrix.python_version }} tags: | - ${{ DOCKER_IMAGE_TAG }} + ${{ env.DOCKER_IMAGE_TAG }} cache-from: type=gha cache-to: type=gha,mode=max - name: Retag container for tests run: | - docker tag ${{ DOCKER_IMAGE_TAG }} ${{ env.PROJECT }}_app + docker tag ${{ env.DOCKER_IMAGE_TAG }} ${{ env.PROJECT }}_app - name: Run tests if: ${{ matrix.run_tests }} From 0a260793f6afdc8054a055068c95045850a14703 Mon Sep 17 00:00:00 2001 From: Lucas Harms Date: Fri, 3 Dec 2021 16:42:34 -0600 Subject: [PATCH 38/62] split sha from env --- .github/workflows/build-and-release.yaml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index 622b19bde..8010295c1 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -79,16 +79,20 @@ jobs: - name: Checkout uses: actions/checkout@v2 - - name: Prepare environment + - name: Get short sha id: vars run: | echo ::set-output name=sha_short::${GITHUB_SHA::16} + shell: bash + + - name: Prepare environment + run: | if [ "$(git log -1 --pretty=%B | head -n 1 | grep '#notests')" ]; then echo 'SKIP_TESTS="1"' >> $GITHUB_ENV fi - echo DOCKER_IMAGE_TAG=${{ env.DOCKERHUB_NAMESPACE }}/${{ env.PROJECT }}:${{ steps.vars.outputs.sha_short }}-${{ matrix.build_name}}${{ env.TAG_SUFFIX }}-${{ matrix.arch }} >> $GITHUB_ENV + echo "DOCKER_IMAGE_TAG=${{ env.DOCKERHUB_NAMESPACE }}/${{ env.PROJECT }}:${{ steps.vars.outputs.sha_short }}-${{ matrix.build_name}}${{ env.TAG_SUFFIX }}-${{ matrix.arch }}" >> $GITHUB_ENV shell: bash - + - name: Set up QEMU uses: docker/setup-qemu-action@v1 From a58a450aeb07443dc77746e32b9ac706d7e9c012 Mon Sep 17 00:00:00 2001 From: Lucas Harms Date: Fri, 3 Dec 2021 16:55:39 -0600 Subject: [PATCH 39/62] delay docker push --- .github/workflows/build-and-release.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index 8010295c1..458f81a5c 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -118,7 +118,8 @@ jobs: uses: docker/build-push-action@v2 with: platforms: linux/${{ matrix.arch }} - push: ${{ matrix.dockerhub_push }} + push: false + load: true build-args: PYTHON_VERSION=${{ matrix.python_version }} tags: | @@ -142,3 +143,7 @@ jobs: else echo Skipping tests fi + + - name: Push image + run: | + docker push ${{ env.DOCKER_IMAGE_TAG }} \ No newline at end of file From 96c853b5878d9e57525d7140e9db0b87738ad970 Mon Sep 17 00:00:00 2001 From: Lucas Harms Date: Fri, 3 Dec 2021 17:07:12 -0600 Subject: [PATCH 40/62] test load and push in docker action at same time --- .github/workflows/build-and-release.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index 458f81a5c..1be392a96 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -118,7 +118,7 @@ jobs: uses: docker/build-push-action@v2 with: platforms: linux/${{ matrix.arch }} - push: false + push: ${{ matrix.dockerhub_push }} load: true build-args: PYTHON_VERSION=${{ matrix.python_version }} @@ -144,6 +144,6 @@ jobs: echo Skipping tests fi - - name: Push image - run: | - docker push ${{ env.DOCKER_IMAGE_TAG }} \ No newline at end of file + # - name: Push image + # run: | + # docker push ${{ env.DOCKER_IMAGE_TAG }} \ No newline at end of file From c014e3c045c0f47c970d0c962194f860806ef1f4 Mon Sep 17 00:00:00 2001 From: Lucas Harms Date: Fri, 3 Dec 2021 17:09:53 -0600 Subject: [PATCH 41/62] split load/push again with condition --- .github/workflows/build-and-release.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index 1be392a96..70624fdeb 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -118,7 +118,7 @@ jobs: uses: docker/build-push-action@v2 with: platforms: linux/${{ matrix.arch }} - push: ${{ matrix.dockerhub_push }} + push: false load: true build-args: PYTHON_VERSION=${{ matrix.python_version }} @@ -144,6 +144,7 @@ jobs: echo Skipping tests fi - # - name: Push image - # run: | - # docker push ${{ env.DOCKER_IMAGE_TAG }} \ No newline at end of file + - name: Push image + if: ${{ matrix.dockerhub_push }} + run: | + docker push ${{ env.DOCKER_IMAGE_TAG }} From 9f14289e9721009d0fc642efbd0767c7333755b6 Mon Sep 17 00:00:00 2001 From: Lucas Harms Date: Fri, 3 Dec 2021 17:47:52 -0600 Subject: [PATCH 42/62] Add manifest --- .github/workflows/build-and-release.yaml | 36 +++++++++++++++++++++--- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index 70624fdeb..d5abb97c8 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -127,13 +127,10 @@ jobs: cache-from: type=gha cache-to: type=gha,mode=max - - name: Retag container for tests - run: | - docker tag ${{ env.DOCKER_IMAGE_TAG }} ${{ env.PROJECT }}_app - - name: Run tests if: ${{ matrix.run_tests }} run: | + docker tag ${{ env.DOCKER_IMAGE_TAG }} ${{ env.PROJECT }}_app if [[ -z $SKIP_TESTS ]]; then docker-compose run app bash -ec ' bin/wait-for-it.sh mysql:3306 \ @@ -148,3 +145,34 @@ jobs: if: ${{ matrix.dockerhub_push }} run: | docker push ${{ env.DOCKER_IMAGE_TAG }} + + multi-arch-manifest: + runs-on: ubuntu-20.04 + + strategy: + matrix: + include: + - build_name: py2.7 + - build_name: py3.8 + + steps: + - name: Get short sha + id: vars + run: | + echo ::set-output name=sha_short::${GITHUB_SHA::16} + shell: bash + + - name: Prepare environment + run: | + if [ "$(git log -1 --pretty=%B | head -n 1 | grep '#notests')" ]; then + echo 'SKIP_TESTS="1"' >> $GITHUB_ENV + fi + echo "DOCKER_IMAGE_TAG=${{ env.DOCKERHUB_NAMESPACE }}/${{ env.PROJECT }}:${{ steps.vars.outputs.sha_short }}-${{ matrix.build_name}}${{ env.TAG_SUFFIX }}" >> $GITHUB_ENV + shell: bash + + - name: Create manifest + run: | + docker buildx imagetools create \ + -t ${{ env.DOCKER_IMAGE_TAG }} \ + ${{ env.DOCKER_IMAGE_TAG }}-amd64 \ + ${{ env.DOCKER_IMAGE_TAG }}-arm64 From 390199ff0dd6c53bea69d0f8fc4c20cacc1073a0 Mon Sep 17 00:00:00 2001 From: Lucas Harms Date: Fri, 3 Dec 2021 17:50:54 -0600 Subject: [PATCH 43/62] add needs --- .github/workflows/build-and-release.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index d5abb97c8..1e3be0394 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -147,8 +147,11 @@ jobs: docker push ${{ env.DOCKER_IMAGE_TAG }} multi-arch-manifest: + needs: + - build-amd64 + runs-on: ubuntu-20.04 - + strategy: matrix: include: From b9bd0c771526ff190c46b69f2a8f4e305fd13988 Mon Sep 17 00:00:00 2001 From: Lucas Harms Date: Fri, 3 Dec 2021 18:02:52 -0600 Subject: [PATCH 44/62] comment arm64 manifest --- .github/workflows/build-and-release.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index 1e3be0394..665a40255 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -149,7 +149,7 @@ jobs: multi-arch-manifest: needs: - build-amd64 - + runs-on: ubuntu-20.04 strategy: @@ -177,5 +177,5 @@ jobs: run: | docker buildx imagetools create \ -t ${{ env.DOCKER_IMAGE_TAG }} \ - ${{ env.DOCKER_IMAGE_TAG }}-amd64 \ - ${{ env.DOCKER_IMAGE_TAG }}-arm64 + ${{ env.DOCKER_IMAGE_TAG }}-amd64 + # ${{ env.DOCKER_IMAGE_TAG }}-arm64 From 802d58d108d84b10b57be7a8803748ce0c2ddf76 Mon Sep 17 00:00:00 2001 From: Lucas Harms Date: Sat, 4 Dec 2021 22:56:04 -0600 Subject: [PATCH 45/62] forgot login --- .github/workflows/build-and-release.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index 665a40255..d68284650 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -173,6 +173,12 @@ jobs: echo "DOCKER_IMAGE_TAG=${{ env.DOCKERHUB_NAMESPACE }}/${{ env.PROJECT }}:${{ steps.vars.outputs.sha_short }}-${{ matrix.build_name}}${{ env.TAG_SUFFIX }}" >> $GITHUB_ENV shell: bash + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Create manifest run: | docker buildx imagetools create \ From 7f2c8a06f3ddb62a5ee17cf508bc6166de569303 Mon Sep 17 00:00:00 2001 From: Lucas Harms Date: Sat, 4 Dec 2021 23:19:58 -0600 Subject: [PATCH 46/62] Add arm64 back for manifest test --- .github/workflows/build-and-release.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index d68284650..c8d43a44b 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -74,6 +74,17 @@ jobs: dockerhub_push: false python_version: "3.9" run_tests: true + + - arch: amd64 + build_name: py2.7 + dockerhub_push: true + python_version: "2.7" + run_tests: false + - arch: amd64 + build_name: py3.8 + dockerhub_push: true + python_version: "3.8" + run_tests: false steps: - name: Checkout From 3c683c1158e166e67a14bc1b35b7482c27c7d1ee Mon Sep 17 00:00:00 2001 From: Lucas Harms Date: Sat, 4 Dec 2021 23:22:57 -0600 Subject: [PATCH 47/62] Add arm64 back for manifest test --- .github/workflows/build-and-release.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index c8d43a44b..4b735e8ba 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -75,12 +75,12 @@ jobs: python_version: "3.9" run_tests: true - - arch: amd64 + - arch: arm64 build_name: py2.7 dockerhub_push: true python_version: "2.7" run_tests: false - - arch: amd64 + - arch: arm64 build_name: py3.8 dockerhub_push: true python_version: "3.8" From 623fa46b337fd18322f97167221db0bbf2bb5244 Mon Sep 17 00:00:00 2001 From: Lucas Harms Date: Sat, 4 Dec 2021 23:44:52 -0600 Subject: [PATCH 48/62] Add arm64 back for manifest test --- .github/workflows/build-and-release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index 4b735e8ba..cd1d06d17 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -195,4 +195,4 @@ jobs: docker buildx imagetools create \ -t ${{ env.DOCKER_IMAGE_TAG }} \ ${{ env.DOCKER_IMAGE_TAG }}-amd64 - # ${{ env.DOCKER_IMAGE_TAG }}-arm64 + ${{ env.DOCKER_IMAGE_TAG }}-arm64 From 4eb37b5ec7e5686ab8632dd4a7a30bc41301d6b0 Mon Sep 17 00:00:00 2001 From: Lucas Harms Date: Sun, 5 Dec 2021 07:38:19 -0600 Subject: [PATCH 49/62] remove arm64 3.8 --- .github/workflows/build-and-release.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index cd1d06d17..7c92991c4 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -80,11 +80,11 @@ jobs: dockerhub_push: true python_version: "2.7" run_tests: false - - arch: arm64 - build_name: py3.8 - dockerhub_push: true - python_version: "3.8" - run_tests: false + # - arch: arm64 + # build_name: py3.8 + # dockerhub_push: true + # python_version: "3.8" + # run_tests: false steps: - name: Checkout @@ -167,7 +167,7 @@ jobs: matrix: include: - build_name: py2.7 - - build_name: py3.8 + # - build_name: py3.8 steps: - name: Get short sha From 60bd1324ad96b2cb6beec3f416d9abfa2c8f405c Mon Sep 17 00:00:00 2001 From: Lucas Harms Date: Sun, 5 Dec 2021 11:04:31 -0600 Subject: [PATCH 50/62] Adds 30s sleep cause Docker Hub thinks files don't exist --- .github/workflows/build-and-release.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index 7c92991c4..51957d8ee 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -190,6 +190,11 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} + - name: Sleep 30s + run: | + echo "sleep 30s for Docker Hub to update" + sleep 30 + - name: Create manifest run: | docker buildx imagetools create \ From 697fc9f05453663c9cb456dc94e767b2dd17af55 Mon Sep 17 00:00:00 2001 From: Lucas Harms Date: Sun, 5 Dec 2021 11:09:42 -0600 Subject: [PATCH 51/62] I'm just an idiot --- .github/workflows/build-and-release.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index 51957d8ee..8423a15f4 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -194,10 +194,10 @@ jobs: run: | echo "sleep 30s for Docker Hub to update" sleep 30 - + - name: Create manifest run: | docker buildx imagetools create \ -t ${{ env.DOCKER_IMAGE_TAG }} \ - ${{ env.DOCKER_IMAGE_TAG }}-amd64 + ${{ env.DOCKER_IMAGE_TAG }}-amd64 \ ${{ env.DOCKER_IMAGE_TAG }}-arm64 From 3827ba0e7120865ca76856a62822b26cd755c97f Mon Sep 17 00:00:00 2001 From: Lucas Harms Date: Sun, 5 Dec 2021 11:33:54 -0600 Subject: [PATCH 52/62] Remove sleep --- .github/workflows/build-and-release.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index 8423a15f4..ffaea393d 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -190,10 +190,10 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - - name: Sleep 30s - run: | - echo "sleep 30s for Docker Hub to update" - sleep 30 + # - name: Sleep 30s + # run: | + # echo "sleep 30s for Docker Hub to update" + # sleep 30 - name: Create manifest run: | From 35a5fb32756341bd0f6713ac171b6ceab6f5d954 Mon Sep 17 00:00:00 2001 From: Lucas Harms Date: Tue, 7 Dec 2021 16:21:34 -0600 Subject: [PATCH 53/62] Separate arm64 workflow --- .github/workflows/build-and-release.yaml | 30 +++-- .github/workflows/build-arm64.yaml | 146 +++++++++++++++++++++++ 2 files changed, 160 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/build-arm64.yaml diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index ffaea393d..7ea821d2c 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -25,7 +25,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v2 with: - python-version: '3.7' + python-version: '3.8' architecture: 'x64' - name: Install dependencies @@ -43,7 +43,7 @@ jobs: run: flake8 - build-amd64: + build: runs-on: ubuntu-20.04 strategy: @@ -75,11 +75,14 @@ jobs: python_version: "3.9" run_tests: true - - arch: arm64 - build_name: py2.7 - dockerhub_push: true - python_version: "2.7" - run_tests: false + # The qemu arm64 builds are *very* slow so they are split out into + # their own workflow + + # - arch: arm64 + # build_name: py2.7 + # dockerhub_push: true + # python_version: "2.7" + # run_tests: false # - arch: arm64 # build_name: py3.8 # dockerhub_push: true @@ -159,7 +162,7 @@ jobs: multi-arch-manifest: needs: - - build-amd64 + - build runs-on: ubuntu-20.04 @@ -167,7 +170,7 @@ jobs: matrix: include: - build_name: py2.7 - # - build_name: py3.8 + - build_name: py3.8 steps: - name: Get short sha @@ -190,14 +193,9 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - # - name: Sleep 30s - # run: | - # echo "sleep 30s for Docker Hub to update" - # sleep 30 - - name: Create manifest run: | docker buildx imagetools create \ -t ${{ env.DOCKER_IMAGE_TAG }} \ - ${{ env.DOCKER_IMAGE_TAG }}-amd64 \ - ${{ env.DOCKER_IMAGE_TAG }}-arm64 + ${{ env.DOCKER_IMAGE_TAG }}-amd64 + # ${{ env.DOCKER_IMAGE_TAG }}-arm64 diff --git a/.github/workflows/build-arm64.yaml b/.github/workflows/build-arm64.yaml new file mode 100644 index 000000000..aee1e44df --- /dev/null +++ b/.github/workflows/build-arm64.yaml @@ -0,0 +1,146 @@ +name: Build and Release + +on: + push: + branches: + - '*' + +concurrency: + group: build-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +env: + DOCKERHUB_NAMESPACE: closeio + PROJECT: sync-engine + # TODO: Remove this after migration + TAG_SUFFIX: "-gha" + +jobs: + build-arm64: + runs-on: ubuntu-20.04 + + strategy: + matrix: + include: + - arch: arm64 + build_name: py2.7 + dockerhub_push: true + python_version: "2.7" + run_tests: false + - arch: arm64 + build_name: py3.8 + dockerhub_push: true + python_version: "3.8" + run_tests: false + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Get short sha + id: vars + run: | + echo ::set-output name=sha_short::${GITHUB_SHA::16} + shell: bash + + - name: Prepare environment + run: | + if [ "$(git log -1 --pretty=%B | head -n 1 | grep '#notests')" ]; then + echo 'SKIP_TESTS="1"' >> $GITHUB_ENV + fi + echo "DOCKER_IMAGE_TAG=${{ env.DOCKERHUB_NAMESPACE }}/${{ env.PROJECT }}:${{ steps.vars.outputs.sha_short }}-${{ matrix.build_name}}${{ env.TAG_SUFFIX }}-${{ matrix.arch }}" >> $GITHUB_ENV + shell: bash + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker context for Buildx + id: buildx-context + run: | + docker context create container-builder + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + with: + version: latest + endpoint: container-builder + + - name: Login to DockerHub + # if: ${{ github.ref == 'master' && github.event.pull_request.merged == true }} + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build and push sync-engine images + uses: docker/build-push-action@v2 + with: + platforms: linux/${{ matrix.arch }} + push: false + load: true + build-args: + PYTHON_VERSION=${{ matrix.python_version }} + tags: | + ${{ env.DOCKER_IMAGE_TAG }} + cache-from: type=gha + cache-to: type=gha,mode=max + + - name: Run tests + if: ${{ matrix.run_tests }} + run: | + docker tag ${{ env.DOCKER_IMAGE_TAG }} ${{ env.PROJECT }}_app + if [[ -z $SKIP_TESTS ]]; then + docker-compose run app bash -ec ' + bin/wait-for-it.sh mysql:3306 \ + && NYLAS_ENV=test pytest --cov-report= --cov=inbox tests/ \ + && coverage html -d pythoncov + ' + else + echo Skipping tests + fi + + - name: Push image + if: ${{ matrix.dockerhub_push }} + run: | + docker push ${{ env.DOCKER_IMAGE_TAG }} + + multi-arch-manifest: + needs: + - build-arm64 + + runs-on: ubuntu-20.04 + + strategy: + matrix: + include: + - build_name: py2.7 + - build_name: py3.8 + + steps: + - name: Get short sha + id: vars + run: | + echo ::set-output name=sha_short::${GITHUB_SHA::16} + shell: bash + + - name: Prepare environment + run: | + if [ "$(git log -1 --pretty=%B | head -n 1 | grep '#notests')" ]; then + echo 'SKIP_TESTS="1"' >> $GITHUB_ENV + fi + echo "DOCKER_IMAGE_TAG=${{ env.DOCKERHUB_NAMESPACE }}/${{ env.PROJECT }}:${{ steps.vars.outputs.sha_short }}-${{ matrix.build_name}}${{ env.TAG_SUFFIX }}" >> $GITHUB_ENV + shell: bash + + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + # Because the arm64 builds are so much slower, we assume they will just + # be appended to the existing manifest created by `build-and-release.yaml`. + - name: Create manifest + run: | + docker buildx imagetools create --append \ + -t ${{ env.DOCKER_IMAGE_TAG }} \ + ${{ env.DOCKER_IMAGE_TAG }}-arm64 \ No newline at end of file From c8fe13177ac4888b45d733ae4f79309d995e7499 Mon Sep 17 00:00:00 2001 From: Lucas Harms Date: Tue, 7 Dec 2021 16:23:47 -0600 Subject: [PATCH 54/62] Fix name/concurrency for arm64 --- .github/workflows/build-arm64.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-arm64.yaml b/.github/workflows/build-arm64.yaml index aee1e44df..90699f478 100644 --- a/.github/workflows/build-arm64.yaml +++ b/.github/workflows/build-arm64.yaml @@ -1,4 +1,4 @@ -name: Build and Release +name: Build arm64 on: push: @@ -6,7 +6,7 @@ on: - '*' concurrency: - group: build-${{ github.event.pull_request.number || github.ref }} + group: build-arm64-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true env: From 9716c7feed2ebccf5b16b9ca787fbf8c326499e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Piotr=20Przeradowski?= Date: Fri, 7 Jan 2022 20:19:33 +0100 Subject: [PATCH 55/62] Drop Python 2.7 and 3.6 support from GHA (#305) --- .github/workflows/build-and-release.yaml | 16 ---------------- .github/workflows/build-arm64.yaml | 6 ------ 2 files changed, 22 deletions(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index 7ea821d2c..f851cfe43 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -49,16 +49,6 @@ jobs: strategy: matrix: include: - - arch: amd64 - build_name: py2.7 - dockerhub_push: true - python_version: "2.7" - run_tests: true - - arch: amd64 - build_name: py3.6 - dockerhub_push: true - python_version: "3.6" - run_tests: true - arch: amd64 build_name: py3.7 dockerhub_push: false @@ -78,11 +68,6 @@ jobs: # The qemu arm64 builds are *very* slow so they are split out into # their own workflow - # - arch: arm64 - # build_name: py2.7 - # dockerhub_push: true - # python_version: "2.7" - # run_tests: false # - arch: arm64 # build_name: py3.8 # dockerhub_push: true @@ -169,7 +154,6 @@ jobs: strategy: matrix: include: - - build_name: py2.7 - build_name: py3.8 steps: diff --git a/.github/workflows/build-arm64.yaml b/.github/workflows/build-arm64.yaml index 90699f478..37a8ffce3 100644 --- a/.github/workflows/build-arm64.yaml +++ b/.github/workflows/build-arm64.yaml @@ -22,11 +22,6 @@ jobs: strategy: matrix: include: - - arch: arm64 - build_name: py2.7 - dockerhub_push: true - python_version: "2.7" - run_tests: false - arch: arm64 build_name: py3.8 dockerhub_push: true @@ -113,7 +108,6 @@ jobs: strategy: matrix: include: - - build_name: py2.7 - build_name: py3.8 steps: From c4ad871e082a88afdec192def2b658007902e5df Mon Sep 17 00:00:00 2001 From: Vyacheslav Tverskoy Date: Mon, 29 Jan 2024 15:56:13 +0000 Subject: [PATCH 56/62] Install linting with no-deps --- .github/workflows/build-and-release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index f851cfe43..6fc11aa7a 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -31,7 +31,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install -r requirements/lint.txt + python -m pip install --no-deps -r requirements/lint.txt - name: Run Black run: black --check . From a0a481c077e69ddff7ec7baac95a63b4962cb0c7 Mon Sep 17 00:00:00 2001 From: Vyacheslav Tverskoy Date: Mon, 29 Jan 2024 16:29:29 +0000 Subject: [PATCH 57/62] Remove setproctitle test --- tests/test_misc.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/tests/test_misc.py b/tests/test_misc.py index d7a19247e..8ffd48bdd 100644 --- a/tests/test_misc.py +++ b/tests/test_misc.py @@ -1,18 +1,8 @@ import pytest -import setproctitle from inbox.models.backends.oauth import hash_token -def test_setproctitle_works(): - original_proctitle = setproctitle.getproctitle() - - setproctitle.setproctitle(test_setproctitle_works.__name__) - assert setproctitle.getproctitle() == test_setproctitle_works.__name__ - - setproctitle.setproctitle(original_proctitle) - - @pytest.mark.parametrize( "prefix,token,expected", [ From 22acef482968486cd5abe2e21abba8ff06b6c718 Mon Sep 17 00:00:00 2001 From: Vyacheslav Tverskoy Date: Tue, 30 Jan 2024 10:42:05 +0000 Subject: [PATCH 58/62] Update actions --- .github/workflows/build-and-release.yaml | 6 +++--- .github/workflows/build-arm64.yaml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index 6fc11aa7a..af430532b 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -20,10 +20,10 @@ jobs: runs-on: ubuntu-20.04 steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Setup Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: '3.8' architecture: 'x64' @@ -76,7 +76,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Get short sha id: vars diff --git a/.github/workflows/build-arm64.yaml b/.github/workflows/build-arm64.yaml index 37a8ffce3..f6ff916ae 100644 --- a/.github/workflows/build-arm64.yaml +++ b/.github/workflows/build-arm64.yaml @@ -30,7 +30,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Get short sha id: vars From bd6c8332ac5acbe1eebb65667c34b7958d403336 Mon Sep 17 00:00:00 2001 From: Vyacheslav Tverskoy Date: Tue, 30 Jan 2024 11:19:15 +0000 Subject: [PATCH 59/62] Add platformdirs --- requirements/lint.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements/lint.txt b/requirements/lint.txt index bc659e98e..d622293f6 100644 --- a/requirements/lint.txt +++ b/requirements/lint.txt @@ -15,6 +15,7 @@ mccabe==0.7.0 mypy==1.8.0 regex==2023.12.25 pathspec==0.12.1 +platformdirs==4.1.0 pyflakes==3.2.0 pycodestyle==2.9.1 toml==0.10.2 From c0c18e0140e2c7f4f25abcfef7bf606175cb158f Mon Sep 17 00:00:00 2001 From: Vyacheslav Tverskoy Date: Tue, 30 Jan 2024 11:29:41 +0000 Subject: [PATCH 60/62] Add packaging --- requirements/lint.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements/lint.txt b/requirements/lint.txt index d622293f6..4395c9e22 100644 --- a/requirements/lint.txt +++ b/requirements/lint.txt @@ -14,6 +14,7 @@ flake8-tidy-imports==4.10.0 mccabe==0.7.0 mypy==1.8.0 regex==2023.12.25 +packaging==23.2 pathspec==0.12.1 platformdirs==4.1.0 pyflakes==3.2.0 From 7f3070d9b6dec27b76fc67f15827f8364a3d2738 Mon Sep 17 00:00:00 2001 From: Vyacheslav Tverskoy Date: Tue, 30 Jan 2024 11:33:38 +0000 Subject: [PATCH 61/62] Update more actions --- .github/workflows/build-and-release.yaml | 10 +++++----- .github/workflows/build-arm64.yaml | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index af430532b..192ebeef9 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -93,7 +93,7 @@ jobs: shell: bash - name: Set up QEMU - uses: docker/setup-qemu-action@v1 + uses: docker/setup-qemu-action@v3 - name: Set up Docker context for Buildx id: buildx-context @@ -101,20 +101,20 @@ jobs: docker context create container-builder - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v3 with: version: latest endpoint: container-builder - name: Login to DockerHub # if: ${{ github.ref == 'master' && github.event.pull_request.merged == true }} - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - name: Build and push sync-engine images - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v5 with: platforms: linux/${{ matrix.arch }} push: false @@ -172,7 +172,7 @@ jobs: shell: bash - name: Login to DockerHub - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} diff --git a/.github/workflows/build-arm64.yaml b/.github/workflows/build-arm64.yaml index f6ff916ae..4bb179adb 100644 --- a/.github/workflows/build-arm64.yaml +++ b/.github/workflows/build-arm64.yaml @@ -47,7 +47,7 @@ jobs: shell: bash - name: Set up QEMU - uses: docker/setup-qemu-action@v1 + uses: docker/setup-qemu-action@v3 - name: Set up Docker context for Buildx id: buildx-context @@ -55,20 +55,20 @@ jobs: docker context create container-builder - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v3 with: version: latest endpoint: container-builder - name: Login to DockerHub # if: ${{ github.ref == 'master' && github.event.pull_request.merged == true }} - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - name: Build and push sync-engine images - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v5 with: platforms: linux/${{ matrix.arch }} push: false @@ -126,7 +126,7 @@ jobs: shell: bash - name: Login to DockerHub - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} From eb35484b5fb94484471e2fad57d33e617a84d6fa Mon Sep 17 00:00:00 2001 From: Vyacheslav Tverskoy Date: Tue, 30 Jan 2024 11:36:34 +0000 Subject: [PATCH 62/62] Fix formatting --- .github/workflows/build-and-release.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index 192ebeef9..be1578ffb 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -27,7 +27,7 @@ jobs: with: python-version: '3.8' architecture: 'x64' - + - name: Install dependencies run: | python -m pip install --upgrade pip @@ -35,13 +35,13 @@ jobs: - name: Run Black run: black --check . - + - name: Run isort run: isort -c . - name: Run flake8 run: flake8 - + build: runs-on: ubuntu-20.04 @@ -73,7 +73,7 @@ jobs: # dockerhub_push: true # python_version: "3.8" # run_tests: false - + steps: - name: Checkout uses: actions/checkout@v4 @@ -91,7 +91,7 @@ jobs: fi echo "DOCKER_IMAGE_TAG=${{ env.DOCKERHUB_NAMESPACE }}/${{ env.PROJECT }}:${{ steps.vars.outputs.sha_short }}-${{ matrix.build_name}}${{ env.TAG_SUFFIX }}-${{ matrix.arch }}" >> $GITHUB_ENV shell: bash - + - name: Set up QEMU uses: docker/setup-qemu-action@v3