From 1051aeab819a0786b389315d22baa1adf7795315 Mon Sep 17 00:00:00 2001 From: Piotr Mionskowski Date: Fri, 10 Nov 2023 14:03:24 +0100 Subject: [PATCH] Inject step before test --- .github/actions/compile-test-lint/action.yml | 19 +++++++++++++++++ .github/workflows/build-test-deploy.yml | 22 ++++---------------- 2 files changed, 23 insertions(+), 18 deletions(-) create mode 100644 .github/actions/compile-test-lint/action.yml diff --git a/.github/actions/compile-test-lint/action.yml b/.github/actions/compile-test-lint/action.yml new file mode 100644 index 0000000..3f4ec4c --- /dev/null +++ b/.github/actions/compile-test-lint/action.yml @@ -0,0 +1,19 @@ +name: compile-test-lint +description: "Will it work" +inputs: + before-test-action: + description: 'Actions to run before test' +runs: + using: "composite" + steps: + - name: "Compile" + run: echo 'Compile' + shell: bash + - uses: ${{ input.before-test-action }} + name: "Before test" + - run: echo 'Test' + name: "Test" + shell: bash + - run: echo 'Lint' + name: "Lint" + shell: bash diff --git a/.github/workflows/build-test-deploy.yml b/.github/workflows/build-test-deploy.yml index ae6261d..9918493 100644 --- a/.github/workflows/build-test-deploy.yml +++ b/.github/workflows/build-test-deploy.yml @@ -4,26 +4,12 @@ on: - main name: Build, Test, Deploy jobs: - compile: + compmile-test-lint: runs-on: ubuntu-latest steps: - - run: echo 'Compile' - name: "Compile" - test: - runs-on: ubuntu-latest - needs: - - compile - steps: - - run: echo 'Test' - name: "Test" - lint: - runs-on: ubuntu-latest - needs: - - compile - steps: - - run: echo 'Lint' - name: "Lint" - + - uses: bright/github-workflows-examples/.github/actions/compile-test-lint + with: + before-test-action: actions/setup-node@v3 deploy-staging: runs-on: ubuntu-latest environment: staging