Skip to content

fixes #5 Cannot delete namespace permission from scabbard CLI #6

fixes #5 Cannot delete namespace permission from scabbard CLI

fixes #5 Cannot delete namespace permission from scabbard CLI #6

name: Unit Test Splinter
on:
pull_request_target:
env:
CARGO_TERM_COLOR: always
concurrency:
group: "${{ github.head_ref }}-${{ github.workflow }}"
cancel-in-progress: true
jobs:
check_allowlist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Check user authorization
run: if ! grep -q -w $GITHUB_ACTOR CODEOWNERS; then (echo "User is not authorized"; exit 1) fi
start_cluster:
if: github.repository == 'Cargill/splinter'
name: Start buildx cluster
needs: check_allowlist
runs-on: ubuntu-latest
outputs:
label: ${{ steps.start_buildx_cluster.outputs.label }}
permissions:
id-token: write
contents: read
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-region: ${{ secrets.AWS_REGION }}
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
- uses: actions/checkout@v2
- name: Start EC2 runner
id: start_buildx_cluster
uses: ./.github/actions/ec2-runners
with:
action: start
amd_ami_id: ${{ secrets.AMD_AMI_ID }}
amd_instance_type: ${{ secrets.AMD_INSTANCE_TYPE }}
arm_ami_id: ${{ secrets.ARM_AMI_ID }}
arm_instance_type: ${{ secrets.ARM_INSTANCE_TYPE }}
gh_personal_access_token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
mode: single
security_group_id: ${{ secrets.SECURITY_GROUP_ID }}
subnet: ${{ secrets.SUBNET }}
- name: Test output
run: echo ${{ steps.start_buildx_cluster.outputs.label }}
unit_test_splinter:
needs: start_cluster
runs-on: ${{ needs.start_cluster.outputs.label }}
steps:
- uses: actions/checkout@v2
with:
ref: "refs/pull/${{ github.event.number }}/merge"
- 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 Splinter
run: just ci-test
stop_cluster:
name: Stop buildx cluster
needs:
- start_cluster
- unit_test_splinter
runs-on: ubuntu-latest
if: ${{ github.repository == 'Cargill/splinter' && always() }}
permissions:
id-token: write
contents: read
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-region: ${{ secrets.AWS_REGION }}
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
- uses: actions/checkout@v2
- name: Destroy cluster
uses: ./.github/actions/ec2-runners
with:
action: stop
label: ${{ needs.start_cluster.outputs.label }}
- name: Notify Slack of Failure
if: cancelled() || failure()
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
fields: repo,message,author,job
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}