From 2a3b0391adfea8c3e5c73ad3b60d17480ec68ef4 Mon Sep 17 00:00:00 2001 From: lzy <3313948393@qq.com> Date: Mon, 2 Dec 2024 14:26:24 +0800 Subject: [PATCH] add workflow --- .github/workflows/10-execution-flow.yml | 52 +++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/10-execution-flow.yml diff --git a/.github/workflows/10-execution-flow.yml b/.github/workflows/10-execution-flow.yml new file mode 100644 index 0000000..0be9e53 --- /dev/null +++ b/.github/workflows/10-execution-flow.yml @@ -0,0 +1,52 @@ +name: 10 - Controlling the Execution Flow +on: + workflow_dispatch: + inputs: + pass-unit-tests: + type: boolean + description: Whether unit tests will pass or not + default: true +jobs: + lint-build: + runs-on: ubuntu-latest + steps: + - name: Lint and build + run: echo "Linting and building project" + unit-tests: + runs-on: ubuntu-latest + steps: + - name: Running unit tests + run: echo "Running tests..." + - name: Failing tests + if: ${{ !inputs.pass-unit-tests }} + run: exit 1 + deploy-nonprod: + runs-on: ubuntu-latest + needs: + - lint-build + - unit-tests + steps: + - name: Deploying to nonprod + run: echo "Deploying to nonprod..." + e2e-tests: + runs-on: ubuntu-latest + needs: + - deploy-nonprod + steps: + - name: Running E2E tests + run: echo "Running E2E tests" + load-tests: + runs-on: ubuntu-latest + needs: + - deploy-nonprod + steps: + - name: Running load tests + run: echo "Running load tests" + deploy-prod: + runs-on: ubuntu-latest + needs: + - e2e-tests + - load-tests + steps: + - name: Deploying to prod + run: echo "Deploying to prod..." \ No newline at end of file