From 2bcfc2a2aa9056604efc34a54ae8a2da4cc18a13 Mon Sep 17 00:00:00 2001 From: Vladimir Skok Date: Fri, 21 May 2021 14:41:50 -0400 Subject: [PATCH 1/6] feat: add CI workflow --- .github/actions/ci.yml | 52 ++++++++++++++++++++++++++++++++++++++++++ .releaserc.json | 17 ++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 .github/actions/ci.yml create mode 100644 .releaserc.json diff --git a/.github/actions/ci.yml b/.github/actions/ci.yml new file mode 100644 index 0000000..5e8d487 --- /dev/null +++ b/.github/actions/ci.yml @@ -0,0 +1,52 @@ +name: ci + +on: + push: + branches: + - '*' + pull_request: + branches: + - '*' + workflow_dispatch: + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: 🐍 Setup Python + uses: actions/setup-python@v2 + with: + python-version: '3.9.4' + + - name: Install PIP dependencies + run: pip3 install -r requirements.txt + + - name: Run tests + run: python3 manage.py -t + + release: + runs-on: ubuntu-latest + needs: build + if: ${{ github.ref == 'refs/heads/master' && github.event_name != 'pull_request'}} + steps: + - name: Cancel previous runs + uses: styfle/cancel-workflow-action@0.9.0 + with: + access_token: ${{ secrets.GITHUB_TOKEN }} + + - name: Checkout + uses: actions/checkout@v2 + + - name: Semantic Release + uses: cycjimmy/semantic-release-action@v2 + id: semantic + with: + extra_plugins: | + @semantic-release/changelog + @semantic-release/git + conventional-changelog-conventionalcommits + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.releaserc.json b/.releaserc.json new file mode 100644 index 0000000..7214611 --- /dev/null +++ b/.releaserc.json @@ -0,0 +1,17 @@ +{ + "plugins": [ + ["@semantic-release/commit-analyzer", { + "preset": "conventionalcommits", + "releaseRules": [{ + "type": "chore", + "release": "patch" + }] + }], + ["@semantic-release/release-notes-generator", { + "preset": "conventionalcommits" + }], + "@semantic-release/changelog", + "@semantic-release/git", + "@semantic-release/github" + ] +} \ No newline at end of file From 1654dfe8ae42789416df142a366db00ddeabb873 Mon Sep 17 00:00:00 2001 From: Vladimir Skok Date: Fri, 21 May 2021 14:42:15 -0400 Subject: [PATCH 2/6] style: lint files --- .releaserc.json | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/.releaserc.json b/.releaserc.json index 7214611..02e3331 100644 --- a/.releaserc.json +++ b/.releaserc.json @@ -1,17 +1,25 @@ { "plugins": [ - ["@semantic-release/commit-analyzer", { - "preset": "conventionalcommits", - "releaseRules": [{ - "type": "chore", - "release": "patch" - }] - }], - ["@semantic-release/release-notes-generator", { + [ + "@semantic-release/commit-analyzer", + { + "preset": "conventionalcommits", + "releaseRules": [ + { + "type": "chore", + "release": "patch" + } + ] + } + ], + [ + "@semantic-release/release-notes-generator", + { "preset": "conventionalcommits" - }], + } + ], "@semantic-release/changelog", "@semantic-release/git", "@semantic-release/github" ] -} \ No newline at end of file +} From 4b80d7bc6b7988215283d794140616d53f691369 Mon Sep 17 00:00:00 2001 From: Vladimir Skok Date: Fri, 21 May 2021 14:47:24 -0400 Subject: [PATCH 3/6] fix: ci workflow --- .github/{actions => workflow}/ci.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/{actions => workflow}/ci.yml (100%) diff --git a/.github/actions/ci.yml b/.github/workflow/ci.yml similarity index 100% rename from .github/actions/ci.yml rename to .github/workflow/ci.yml From 8058cdc6e5f41fb04e2cf067521f58c8b635142c Mon Sep 17 00:00:00 2001 From: Vladimir Skok Date: Fri, 21 May 2021 14:48:24 -0400 Subject: [PATCH 4/6] fix: ci workflow --- .github/{workflow => workflows}/ci.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/{workflow => workflows}/ci.yml (100%) diff --git a/.github/workflow/ci.yml b/.github/workflows/ci.yml similarity index 100% rename from .github/workflow/ci.yml rename to .github/workflows/ci.yml From b00f98867e403d3a521a3e8f8cee3ccf157d8e11 Mon Sep 17 00:00:00 2001 From: Vladimir Skok Date: Fri, 21 May 2021 14:49:47 -0400 Subject: [PATCH 5/6] fix: ci workflow --- .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 5e8d487..4824686 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,7 +29,7 @@ jobs: release: runs-on: ubuntu-latest - needs: build + needs: test if: ${{ github.ref == 'refs/heads/master' && github.event_name != 'pull_request'}} steps: - name: Cancel previous runs From df5c85070239bc06d212db1d68f7d2382cbd8e5f Mon Sep 17 00:00:00 2001 From: Vladimir Skok Date: Fri, 21 May 2021 14:53:13 -0400 Subject: [PATCH 6/6] fix: test step in CI workflow --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4824686..639b999 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,14 +18,14 @@ jobs: - name: 🐍 Setup Python uses: actions/setup-python@v2 - with: - python-version: '3.9.4' + # with: + # python-version: '3.9.4' - name: Install PIP dependencies run: pip3 install -r requirements.txt - name: Run tests - run: python3 manage.py -t + run: python3 -m unittest release: runs-on: ubuntu-latest