Skip to content

Instantly share code, notes, and snippets.

- name: Cancel Previous Runs for the same branch
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
@titooan
titooan / innovorder-ci-example-job-timeout.yml
Created February 18, 2022 20:24
Adding a timeout to the job
build-for-PR:
runs-on: buildjet-4vcpu-ubuntu-2004
timeout-minutes: 30
@titooan
titooan / innovorder-ci-example-step-timeout.yml
Last active February 18, 2022 20:23
Adding a timeout to a step
- name: publish preprod apk to App Center
run: appcenter distribute release --app PREPROD_APP_ID
--file app/build/outputs/apk/preprod/release/app-preprod-release.apk
--token ${{secrets.OUR_APPCENTER_TOKEN}} --group GROUP_NAME
timeout-minutes: 1
- name: Test Report
uses: dorny/test-reporter@v1
if: always()# run this step even if previous step failed
with:
name: JUnit Tests
path: app/build/test-results/testDevDebugUnitTest/TEST-*.xml# Path to test results
reporter: java-junit# Format of test results
fail-on-error: false
@titooan
titooan / innovorder-ci-example-upload-reports.yml
Created February 18, 2022 20:13
Compress and upload test reports
- name: zip build reports
id: zipBuildReports
if: always()
run: cd app/build/reports && zip -r ../../../build-reports.zip ./* && cd -
- name: Upload build reports
if: always() && steps.zipBuildReports.outcome == 'success'
uses: actions/upload-artifact@v2
with:
name: build-reports
@titooan
titooan / innovorder-ci-example-build-reports.yml
Created February 18, 2022 17:40
Upload build reports action
- name: Upload build reports
if: always()
uses: actions/upload-artifact@v2
with:
name: build-reports
path: app/build/reports
@titooan
titooan / innovorder-ci-example-buildjet.yml
Created February 18, 2022 17:30
Example of a workflow using BuildJet
jobs:
build-for-PR:
runs-on: buildjet-4vcpu-ubuntu-2004
@titooan
titooan / innovorder-ci-example-10.yml
Created February 18, 2022 17:12
Send a Slack Notification
- name: Send Slack notification
if: always()
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
fields: repo,message,commit,author,eventName,ref,workflow,job,took,pullRequest
env:
SLACK_WEBHOOK_URL: ${{ secrets.OUR_SLACK_WEBHOOK_URL }}
@titooan
titooan / innovorder-ci-example-9.yml
Created February 18, 2022 17:11
Clear sensitive data
- name: Remove all decrypted files
if: always()
run: rm rkeystore_destination_path keystore_destination-properties_path github-properties_path
@titooan
titooan / innovorder-ci-example-8.yml
Created February 18, 2022 17:06
Upload apks on AppCenter
- uses: actions/setup-node@v2
with:
node-version: '14'
cache: npm
cache-dependency-path: '**/package-lock.json'
- run: npm install -g appcenter-cli
- name: publish dev apk to App Center
run: appcenter distribute release --app DEV_APP_ID