From fd24fe7ba6d73b2cc553c2d68b45cd1cbafb30eb Mon Sep 17 00:00:00 2001 From: Wim Velzeboer Date: Mon, 28 Jun 2021 10:48:07 +0100 Subject: [PATCH] Add git workflow --- .github/workflows/deploy.and.test.yml | 30 +++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/deploy.and.test.yml diff --git a/.github/workflows/deploy.and.test.yml b/.github/workflows/deploy.and.test.yml new file mode 100644 index 0000000..7322380 --- /dev/null +++ b/.github/workflows/deploy.and.test.yml @@ -0,0 +1,30 @@ +name: Create a Scratch Org, Push Source and Run Apex Tests + +on: + push: + pull_request_target: + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + with: + ref: ${{github.event.pull_request.head.ref}} + repository: ${{github.event.pull_request.head.repo.full_name}} + - name: Install SFDX CLI and authorize DevHub + uses: sfdx-actions/setup-sfdx@v1 + with: + sfdx-auth-url: ${{ secrets.SFDX_AUTH_URL }} + - run: echo y | sfdx force:org:list + - run: echo y | sfdx plugins:install shane-sfdx-plugins + - run: sfdx force:org:create -f config/project-scratch-def.json --setdefaultusername -d 1 + - run: sfdx shane:github:src:install -c -g apex-enterprise-patterns -r fflib-apex-mocks -p sfdx-source/apex-mocks + - run: sfdx shane:github:src:install -c -g apex-enterprise-patterns -r fflib-apex-common -p sfdx-source/apex-common + - run: sfdx force:source:push + - run: sfdx force:apex:test:run -w 5 + - name: Destroy scratch org + run: sfdx force:org:delete -p + if: always()