Skip to content

0-8 Cron

0-8 Cron #66

Workflow file for this run

name: 0-8 Cron
on:
schedule:
- cron: "0 7 * * *"
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
slack-channel: 'alerts'
concurrency:
group: "${{ github.ref }}-${{ github.workflow }}"
cancel-in-progress: true
jobs:
update_status:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
ref: 0-8
- name: get SHA
run: echo "SHA=$(git rev-parse HEAD)" >> $GITHUB_ENV
- name: Update commit status to pending
run: |
env
curl \
-X POST \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/statuses/${{ env.SHA }} \
-d '{"state": "pending", "context": "Cron"}'
lint_sabre:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: 0-8
- name: Display envvars
run: env
- name: Install Just
run: curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | sudo bash -s -- --to /usr/local/bin
- name: Run Lint/Clippy on Sabre
run: just ci-lint
- name: Notify Slack of Failure
if: failure()
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
fields: repo,message,author,job
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
unit_test_sabre:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: 0-8
- name: Display envvars
run: env
- name: Install Just
run: curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | sudo bash -s -- --to /usr/local/bin
- name: Unit Test Sabre
run: just ci-test
- name: Notify Slack of Failure
if: failure()
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
fields: repo,message,author,job
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
integration_tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: 0-8
- name: Display envvars
run: env
- name: Install Just
run: curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | sudo bash -s -- --to /usr/local/bin
- name: Run Integration Tests
run: just integration-test
- name: Notify Slack of Failure
if: failure()
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
fields: repo,message,author,job
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
build_docker:
runs-on: ubuntu-latest
if: >-
github.repository_owner == 'hyperledger'
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
ref: 0-8
- name: Display envvars
run: env
- name: Install Just
run: curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | sudo bash -s -- --to /usr/local/bin
- name: Test Docker Build
run: just docker-build
- name: Copy Artifacts
run: docker-compose -f docker/compose/copy-artifacts.yaml up
- name: Archive Artifacts
run: zip -r sabre.zip build/*
- uses: actions/upload-artifact@v2
with:
name: sabre
path: sabre.zip
- name: Notify Slack of Failure
if: failure()
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
fields: repo,message,author,job
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
publish_artifacts:
needs: [lint_sabre, unit_test_sabre, integration_tests, build_docker]
if: >-
github.repository_owner == 'hyperledger'
runs-on: ubuntu-latest
steps:
- name: Display envvars
run: env
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
- uses: actions/download-artifact@v2
with:
name: sabre
- name: Upload Artifacts To S3
run: |
aws s3 cp ./sabre.zip s3://${{ secrets.AWS_S3_BUCKET }}/sawtooth-sabre/0-8/
- name: Notify Slack of Failure
if: failure()
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
fields: repo,message,author,job
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}