From a5c7c5d4969df8fede865452db541aeaf0203281 Mon Sep 17 00:00:00 2001 From: SKairinos Date: Mon, 4 Mar 2024 15:37:20 +0000 Subject: [PATCH] setup pipeline --- .github/actions/git/setup-bot/action.yaml | 2 +- .github/workflows/configure-submodules.yaml | 35 +++++++++++++++++++++ .submodules/{config.py => __main__.py} | 0 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/configure-submodules.yaml rename .submodules/{config.py => __main__.py} (100%) diff --git a/.github/actions/git/setup-bot/action.yaml b/.github/actions/git/setup-bot/action.yaml index 2c45e3b4..5e9bdfcb 100644 --- a/.github/actions/git/setup-bot/action.yaml +++ b/.github/actions/git/setup-bot/action.yaml @@ -3,7 +3,7 @@ description: "Sets up CFL's bot as the Git user." runs: using: composite steps: - - name: ⚙️ Set up cfl-bot as Git user + - name: 🤖 Set up cfl-bot as Git user shell: bash run: | git config --local user.name cfl-bot diff --git a/.github/workflows/configure-submodules.yaml b/.github/workflows/configure-submodules.yaml new file mode 100644 index 00000000..fcffe56f --- /dev/null +++ b/.github/workflows/configure-submodules.yaml @@ -0,0 +1,35 @@ +name: Configure Submodules + +on: + push: + # branches: + # - main + paths: + - '.submodules/**' + workflow_dispatch: + +jobs: + configure: + runs-on: ubuntu-latest + env: + PYTHON_VERSION: 3.11 + WORKING_DIR: .submodules + steps: + - name: 🛫 Checkout + uses: actions/checkout@v4 + with: + submodules: 'recursive' + + - name: 🐍 Set up Python ${{ env.PYTHON_VERSION }} Environment + uses: ocadotechnology/codeforlife-workspace/.github/actions/python/setup-environment@main + with: + python-version: ${{ env.PYTHON_VERSION }} + working-directory: ${{ env.WORKING_DIR }} + + - uses: ocadotechnology/codeforlife-workspace/.github/actions/git/setup-bot@main + + - name: ⚙️ Configure Submodules + working-directory: ${{ env.WORKING_DIR }} + run: pipenv run python . + env: + GIT_PUSH_CHANGES: '0' # TODO: set to 1 and allow bot to force push diff --git a/.submodules/config.py b/.submodules/__main__.py similarity index 100% rename from .submodules/config.py rename to .submodules/__main__.py