Skip to content

Commit

Permalink
Merge pull request #134 from kryvyifedir/95-use-standard-salesforce-c…
Browse files Browse the repository at this point in the history
…ontainer-for-cicd

Reverting an old version to test
  • Loading branch information
kryvyifedir authored Feb 18, 2024
2 parents ec6bea6 + 0bc4e89 commit c0827ec
Showing 1 changed file with 40 additions and 12 deletions.
52 changes: 40 additions & 12 deletions .github/workflows/pullrequest_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,46 @@ on:
- 'docs/*'
- '.github/workflows/*'

jobs:
build:
runs-on: ubuntu-latest
steps:
# Checkout the Source code from the latest commit
- uses: actions/checkout@v3
with:
fetch-depth: 0
# Installing NPM so that SFDX can be installed
- name: Installing NPM
run: |
npm install
# Installing SFDX CLI
- name: Installing SFDX CLI
run: |
npm install @salesforce/cli --global
# Creating new .key for .crt file stored in the Connected App
- name: Creating .key file
run: |
touch server.key
echo -e "${{ secrets.SF_CICD_SERVERKEY }}" >> server.key
# Authorizing to DevHub
- name: Authorizing the DevHub
run: sf org login jwt --json --alias DevHub --set-default --set-default-dev-hub --username "${{ secrets.SF_CICD_USERNAME }}" --keyfile /home/runner/work/game-force/game-force/server.key --clientid ${{ secrets.SF_CLIENT_SECRET }}

# Creating a Scratch Org using the pull request number
- name: Creating a Scratch Org
run: sf org create scratch --target-dev-hub DevHub --name build_${{ github.event.pull_request.number }} --definition-file config/project-scratch-def.json --set-default --duration-days 1

# Pushing source to the Scratch Org
- name: Pushing source and metadata to the Scratch Org
run: sf project deploy start

# Executing all unit tests
- name: Run unit tests
run: sf apex run test --wait 30 --test-level RunAllTestsInOrg --code-coverage

# DOCKER VERSION DOESN'T WORK YET
jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -25,18 +65,6 @@ jobs:
with:
fetch-depth: 0

# Installing NPM so that SFDX can be installed
# - name: Installing NPM
# run: |
# npm install

# Installing SFDX CLI
# - name: Installing SFDX CLI
# run: |
# npm install @salesforce/cli --global



# Creating new .key for .crt file stored in the Connected App
- name: Creating .key file
run: |
Expand Down

1 comment on commit c0827ec

@kryvyifedir
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disclaimer: this commit was a part of an attempt to use Docker image provided by SF to run CI for the project. Due to the nature of GitHub Actions, a lot of commits had to be made to dev branch during investigation. Changes made during the investigation were reverted. Please ignore this PR

Please sign in to comment.