From 42f6bf4e0c09a9b57558b5e354dfb3daea781e2f Mon Sep 17 00:00:00 2001 From: SKairinos Date: Fri, 15 Dec 2023 11:40:30 +0000 Subject: [PATCH] fix pipeline --- .github/workflows/main.yml | 105 +++++++++++++------------------------ 1 file changed, 37 insertions(+), 68 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f82a72c6..5bf3c35c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,76 +14,45 @@ env: PYTHON_VERSION: 3.8 jobs: - docs: + test: runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: [3.8] steps: - - uses: actions/checkout@v4 - - id: foo - uses: ocadotechnology/codeforlife-action-docs/.github/actions/hello@main + - uses: ocadotechnology/codeforlife-workspace/.github/actions/python/test@actions # TODO: use @main with: - who-to-greet: 'Mona the Octocat' - - run: echo random-number ${{ steps.foo.outputs.random-number }} - shell: bash + python-version: ${{ matrix.python-version }} - # test: - # runs-on: ubuntu-latest - # strategy: - # fail-fast: false - # matrix: - # python-version: [3.8] - # steps: - # - name: ๐Ÿ›ซ Checkout - # uses: actions/checkout@v3 - - # - name: ๐Ÿ Set up Python ${{ matrix.python-version }} - # uses: actions/setup-python@v4 - # with: - # python-version: ${{ matrix.python-version }} - - # - name: ๐Ÿ›  Install Dependencies - # run: | - # python -m pip install --upgrade pip - # python -m pip install pipenv - # pipenv install --dev - - # - name: ๐Ÿ”Ž Check Code Format - # run: if ! pipenv run black --check .; then exit 1; fi - - # - name: ๐Ÿ”Ž Check Migrations - # run: pipenv run python manage.py makemigrations --check --dry-run - - # # TODO: assert code coverage target. - # - name: ๐Ÿงช Test Code Units - # run: pipenv run pytest - - # release: - # concurrency: release - # runs-on: ubuntu-latest - # needs: [test] - # if: github.ref_name == 'main' - # steps: - # - name: ๐Ÿ›ซ Checkout - # uses: actions/checkout@v3 - # with: - # token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - # fetch-depth: 0 - - # - name: ๐Ÿ Set up Python - # uses: actions/setup-python@v4 - # with: - # python-version: ${{ env.PYTHON_VERSION }} - - # - name: ๐Ÿ›  Install Dependencies - # run: | - # python -m pip install --upgrade pip - # python -m pip install python-semantic-release~=7.33 - - # - name: โš™๏ธ Configure Git - # run: | - # git config --local user.name cfl-bot - # git config --local user.email codeforlife-bot@ocado.com + release: + concurrency: release + runs-on: ubuntu-latest + needs: [test] + if: github.ref_name == 'main' + steps: + - name: ๐Ÿ›ซ Checkout + uses: actions/checkout@v3 + with: + token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + fetch-depth: 0 - # - name: ๐Ÿš€ Publish Semantic Release - # env: - # GH_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - # run: semantic-release publish --verbosity=INFO + - name: ๐Ÿ Set up Python + uses: actions/setup-python@v4 + with: + python-version: ${{ env.PYTHON_VERSION }} + + - name: ๐Ÿ›  Install Dependencies + run: | + python -m pip install --upgrade pip + python -m pip install python-semantic-release~=7.33 + + - name: โš™๏ธ Configure Git + run: | + git config --local user.name cfl-bot + git config --local user.email codeforlife-bot@ocado.com + + - name: ๐Ÿš€ Publish Semantic Release + env: + GH_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + run: semantic-release publish --verbosity=INFO