Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ci] Add actionlint job #3160

Merged
merged 1 commit into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/actionlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
self-hosted-runner:
labels:
- custom-arm64-focal
- custom-arm64-jammy
- net-outage-sim
8 changes: 4 additions & 4 deletions .github/workflows/build-linux-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ jobs:
if: "${{ github.event.inputs.tag == '' }}"
id: get_tag_from_git
run: |
echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
echo "TAG=${GITHUB_REF/refs\/tags\//}" >> "$GITHUB_ENV"
shell: bash

- name: Try to get tag from workflow dispatch
if: "${{ github.event.inputs.tag != '' }}"
id: get_tag_from_workflow
run: |
echo "TAG=${{ github.event.inputs.tag }}" >> $GITHUB_ENV
echo "TAG=${{ github.event.inputs.tag }}" >> "$GITHUB_ENV"
shell: bash

- name: Create tgz package structure and upload to S3
Expand Down Expand Up @@ -101,14 +101,14 @@ jobs:
if: "${{ github.event.inputs.tag == '' }}"
id: get_tag_from_git
run: |
echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
echo "TAG=${GITHUB_REF/refs\/tags\//}" >> "$GITHUB_ENV"
shell: bash

- name: Try to get tag from workflow dispatch
if: "${{ github.event.inputs.tag != '' }}"
id: get_tag_from_workflow
run: |
echo "TAG=${{ github.event.inputs.tag }}" >> $GITHUB_ENV
echo "TAG=${{ github.event.inputs.tag }}" >> "$GITHUB_ENV"
shell: bash

- name: Create tgz package structure and upload to S3
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build-macos-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,18 @@ jobs:
if: "${{ github.event.inputs.tag == '' }}"
id: get_tag_from_git
run: |
echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
echo "TAG=${GITHUB_REF/refs\/tags\//}" >> "$GITHUB_ENV"
shell: bash

- name: Try to get tag from workflow dispatch
if: "${{ github.event.inputs.tag != '' }}"
id: get_tag_from_workflow
run: |
echo "TAG=${{ github.event.inputs.tag }}" >> $GITHUB_ENV
echo "TAG=${{ github.event.inputs.tag }}" >> "$GITHUB_ENV"
shell: bash

- name: Create zip file
run: 7z a avalanchego-macos-${TAG}.zip build/avalanchego
run: 7z a "avalanchego-macos-${TAG}.zip" build/avalanchego
env:
TAG: ${{ env.TAG }}

Expand All @@ -63,7 +63,7 @@ jobs:
aws-region: us-east-1

- name: Upload file to S3
run: aws s3 cp avalanchego-macos-${{ env.TAG }}.zip s3://${BUCKET}/macos/
run: aws s3 cp avalanchego-macos-${{ env.TAG }}.zip "s3://${BUCKET}/macos/"
env:
BUCKET: ${{ secrets.BUCKET }}

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build-public-ami.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,24 @@ jobs:
- name: Install aws cli
run: |
sudo apt update
sudo apt-get -y install python3-boto3=${PYTHON3_BOTO3_VERSION}
sudo apt-get -y install python3-boto3="${PYTHON3_BOTO3_VERSION}"

- name: Get the tag
id: get_tag
run: |
if [[ ${{ github.event_name }} == 'push' ]];
then
echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
echo "TAG=${GITHUB_REF/refs\/tags\//}" >> "$GITHUB_ENV"
else
echo "TAG=${{ inputs.tag }}" >> $GITHUB_ENV
echo "TAG=${{ inputs.tag }}" >> "$GITHUB_ENV"
fi
shell: bash

- name: Set whether to skip ami creation in packer
run: |
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
echo "Setting SKIP_CREATE_AMI to False"
echo "SKIP_CREATE_AMI=False" >> $GITHUB_ENV
echo "SKIP_CREATE_AMI=False" >> "$GITHUB_ENV"
fi

- name: Configure AWS credentials
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build-ubuntu-amd64-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ jobs:
if: "${{ github.event.inputs.tag == '' }}"
id: get_tag_from_git
run: |
echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
echo "TAG=${GITHUB_REF/refs\/tags\//}" >> "$GITHUB_ENV"
shell: bash

- name: Try to get tag from workflow dispatch
if: "${{ github.event.inputs.tag != '' }}"
id: get_tag_from_workflow
run: |
echo "TAG=${{ github.event.inputs.tag }}" >> $GITHUB_ENV
echo "TAG=${{ github.event.inputs.tag }}" >> "$GITHUB_ENV"
shell: bash

- name: Create debian package
Expand Down Expand Up @@ -88,14 +88,14 @@ jobs:
if: "${{ github.event.inputs.tag == '' }}"
id: get_tag_from_git
run: |
echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
echo "TAG=${GITHUB_REF/refs\/tags\//}" >> "$GITHUB_ENV"
shell: bash

- name: Try to get tag from workflow dispatch
if: "${{ github.event.inputs.tag != '' }}"
id: get_tag_from_workflow
run: |
echo "TAG=${{ github.event.inputs.tag }}" >> $GITHUB_ENV
echo "TAG=${{ github.event.inputs.tag }}" >> "$GITHUB_ENV"
shell: bash

- name: Configure AWS credentials
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build-ubuntu-arm64-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ jobs:
if: "${{ github.event.inputs.tag == '' }}"
id: get_tag_from_git
run: |
echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
echo "TAG=${GITHUB_REF/refs\/tags\//}" >> "$GITHUB_ENV"
shell: bash

- name: Try to get tag from workflow dispatch
if: "${{ github.event.inputs.tag != '' }}"
id: get_tag_from_workflow
run: |
echo "TAG=${{ github.event.inputs.tag }}" >> $GITHUB_ENV
echo "TAG=${{ github.event.inputs.tag }}" >> "$GITHUB_ENV"
shell: bash

- name: Create debian package
Expand Down Expand Up @@ -96,14 +96,14 @@ jobs:
if: "${{ github.event.inputs.tag == '' }}"
id: get_tag_from_git
run: |
echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
echo "TAG=${GITHUB_REF/refs\/tags\//}" >> "$GITHUB_ENV"
shell: bash

- name: Try to get tag from workflow dispatch
if: "${{ github.event.inputs.tag != '' }}"
id: get_tag_from_workflow
run: |
echo "TAG=${{ github.event.inputs.tag }}" >> $GITHUB_ENV
echo "TAG=${{ github.event.inputs.tag }}" >> "$GITHUB_ENV"
shell: bash

- name: Create debian package
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-win-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ jobs:
if: "${{ github.event.inputs.tag == '' }}"
id: get_tag_from_git
run: |
echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
echo "TAG=${GITHUB_REF/refs\/tags\//}" >> "$GITHUB_ENV"
shell: bash

- name: Try to get tag from workflow dispatch
if: "${{ github.event.inputs.tag != '' }}"
id: get_tag_from_workflow
run: |
echo "TAG=${{ github.event.inputs.tag }}" >> $GITHUB_ENV
echo "TAG=${{ github.event.inputs.tag }}" >> "$GITHUB_ENV"
shell: bash

# Runs a single command using the runners shell
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Set timeout on Windows # Windows UT run slower and need a longer timeout
shell: bash
if: matrix.os == 'windows-2022'
run: echo "TIMEOUT=240s" >> $GITHUB_ENV
run: echo "TIMEOUT=240s" >> "$GITHUB_ENV"
- name: build_test
shell: bash
run: ./scripts/build_test.sh
Expand Down Expand Up @@ -213,6 +213,9 @@ jobs:
- name: Run shellcheck
shell: bash
run: scripts/shellcheck.sh
- name: Run actionlint
shell: bash
run: scripts/actionlint.sh
buf-lint:
name: Protobuf Lint
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish_antithesis_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ jobs:
run: bash -x ./scripts/build_antithesis_images.sh
env:
IMAGE_PREFIX: ${{ env.REGISTRY }}/${{ env.REPOSITORY }}
TAG: ${{ github.events.inputs.image_tag || 'latest' }}
TAG: ${{ github.event.inputs.image_tag || 'latest' }}
StephenButtolph marked this conversation as resolved.
Show resolved Hide resolved
TEST_SETUP: avalanchego

- name: Build and push images for xsvm test setup
run: bash -x ./scripts/build_antithesis_images.sh
env:
IMAGE_PREFIX: ${{ env.REGISTRY }}/${{ env.REPOSITORY }}
TAG: ${{ github.events.inputs.image_tag || 'latest' }}
TAG: ${{ github.event.inputs.image_tag || 'latest' }}
TEST_SETUP: xsvm
22 changes: 12 additions & 10 deletions .github/workflows/trigger-antithesis-runs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ on:
type: string

jobs:
Run Antithesis Avalanchego Test Setup:
antithesis_avalanchego:
name: Run Antithesis Avalanchego Test Setup
runs-on: ubuntu-latest
steps:
- uses: antithesishq/[email protected]
Expand All @@ -31,12 +32,13 @@ jobs:
username: ${{ secrets.ANTITHESIS_USERNAME }}
password: ${{ secrets.ANTITHESIS_PASSWORD }}
github_token: ${{ secrets.ANTITHESIS_GH_PAT }}
config_image: antithesis-avalanchego-config@${{ github.events.inputs.image_tag }}
images: antithesis-avalanchego-workload@${{ github.events.inputs.image_tag }};antithesis-avalanchego-node@${{ github.events.inputs.image_tag }}
email_recipients: ${{ github.events.inputs.recipients }}
config_image: antithesis-avalanchego-config@${{ github.event.inputs.image_tag || 'latest' }}
images: antithesis-avalanchego-workload@${{ github.event.inputs.image_tag || 'latest' }};antithesis-avalanchego-node@${{ github.event.inputs.image_tag || 'latest' }}
email_recipients: ${{ github.event.inputs.recipients || secrets.ANTITHESIS_RECIPIENTS }}
additional_parameters: |-
custom.duration=${{ github.events.inputs.duration }}
Run Antithesis XSVM Test Setup:
custom.duration=${{ github.event.inputs.duration || '0.5' }}
antithesis_xsvm:
name: Run Antithesis XSVM Test Setup
runs-on: ubuntu-latest
steps:
- uses: antithesishq/[email protected]
Expand All @@ -46,8 +48,8 @@ jobs:
username: ${{ secrets.ANTITHESIS_USERNAME }}
password: ${{ secrets.ANTITHESIS_PASSWORD }}
github_token: ${{ secrets.ANTITHESIS_GH_PAT }}
config_image: antithesis-xsvm-config@${{ github.events.inputs.image_tag }}
images: antithesis-xsvm-workload@${{ github.events.inputs.image_tag }};antithesis-xsvm-node@${{ github.events.inputs.image_tag }}
email_recipients: ${{ github.events.inputs.recipients }}
config_image: antithesis-xsvm-config@${{ github.event.inputs.image_tag || 'latest' }}
images: antithesis-xsvm-workload@${{ github.event.inputs.image_tag || 'latest' }};antithesis-xsvm-node@${{ github.event.inputs.image_tag || 'latest' }}
email_recipients: ${{ github.event.inputs.recipients || secrets.ANTITHESIS_RECIPIENTS }}
additional_parameters: |-
custom.duration=${{ github.events.inputs.duration }}
custom.duration=${{ github.event.inputs.duration || '0.5' }}
7 changes: 7 additions & 0 deletions scripts/actionlint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

set -euo pipefail

go install github.com/rhysd/actionlint/cmd/[email protected]

actionlint
Loading