Merge pull request #17 from Firtzberg/immutable-optional-wrappers #18
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
# Controls when the workflow will run | |
on: | |
# Triggers the workflow on push or pull request events but only for the master branch | |
push: | |
branches: [ master ] | |
paths: | |
- 'sfdx-source/**' | |
pull_request: | |
branches: [ master ] | |
paths: | |
- 'sfdx-source/**' | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
build: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v2 | |
# https://developer.salesforce.com/blogs/2020/01/using-salesforce-dx-with-github-actions | |
- name: Install Salesforce CLI from binary | |
run: | | |
wget https://developer.salesforce.com/media/salesforce-cli/sfdx-linux-amd64.tar.xz | |
mkdir sfdx-cli | |
tar xJf sfdx-linux-amd64.tar.xz -C sfdx-cli --strip-components 1 | |
sudo ./sfdx-cli/install | |
- name: Write the dev hub token into a file | |
run: 'echo ${{secrets.SFDX_AUTH_URL}} > dev-hub-token' | |
- name: Authenticate with the dev hub | |
run: sfdx force:auth:sfdxurl:store -f dev-hub-token --setalias DevHub --setdefaultdevhubusername | |
- name: Create scratch org | |
run: sfdx force:org:create -f config/project-scratch-def.json --setalias test-scratch | |
- name: Push source | |
run: sfdx force:source:push --targetusername test-scratch | |
- name: Run tests | |
run: sfdx force:apex:test:run --targetusername test-scratch --codecoverage --resultformat human --outputdir ./tests/apex | |
- name: Upload code coverage | |
uses: codecov/codecov-action@v2 | |
with: | |
flags: Apex | |
- name: Delete scratch org | |
if: always() | |
run: sfdx force:org:delete --targetusername test-scratch --noprompt | |