From 97ca68fba1d57beb9ff85159fe6691bac6d634c9 Mon Sep 17 00:00:00 2001 From: ashmrtn Date: Thu, 11 May 2023 12:05:15 -0700 Subject: [PATCH] Re-add GitHub Actions linting (#3391) Move linting into the main CI workflow Split into a different PR so that the file checker gets updated and we can actually see if this is working as intended --- #### Does this PR need a docs update or release note? - [ ] :white_check_mark: Yes, it's included - [ ] :clock1: Yes, but in a later PR - [x] :no_entry: No #### Type of change - [x] :sunflower: Feature - [ ] :bug: Bugfix - [ ] :world_map: Documentation - [ ] :robot: Supportability/Tests - [x] :computer: CI/Deployment - [ ] :broom: Tech Debt/Cleanup #### Issue(s) * closes #3389 #### Test Plan - [x] :muscle: Manual - [ ] :zap: Unit test - [ ] :green_heart: E2E --- .github/workflows/ci.yml | 32 ++++++++++++++++++++++++++---- .github/workflows/sanity-test.yaml | 6 +++--- 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2771a4b95..5a344bf59 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -364,7 +364,7 @@ jobs: # --- Source Code Linting ---------------------------------------------------------------------------- # ---------------------------------------------------------------------------------------------------- - Linting: + Source-Code-Linting: needs: [Precheck, Checkout] environment: Testing runs-on: ubuntu-latest @@ -404,12 +404,36 @@ jobs: working-directory: src + # ---------------------------------------------------------------------------------------------------- + # --- GitHub Actions Linting ------------------------------------------------------------------------- + # ---------------------------------------------------------------------------------------------------- + + Actions-Lint: + needs: [Precheck] + environment: Testing + runs-on: ubuntu-latest + if: needs.precheck.outputs.actionsfileschanged == 'true' + steps: + - uses: actions/checkout@v3 + + - name: actionlint + uses: raven-actions/actionlint@v1 + with: + fail-on-error: true + cache: true + # Ignore + # * combining commands into a subshell and using single output + # redirect + # * various variable quoting patterns + # * possible ineffective echo commands + flags: "-ignore SC2129 -ignore SC2086 -ignore SC2046 -ignore 2116" + # ---------------------------------------------------------------------------------------------------- # --- Publish steps ---------------------------------------------------------------------------------- # ---------------------------------------------------------------------------------------------------- Publish-Binary: - needs: [Test-Suite-Trusted, Linting, Website-Linting, SetEnv] + needs: [Test-Suite-Trusted, Source-Code-Linting, Website-Linting, SetEnv] environment: ${{ needs.SetEnv.outputs.environment }} runs-on: ubuntu-latest if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main' @@ -426,7 +450,7 @@ jobs: rudderstack_data_plane_url: ${{ secrets.RUDDERSTACK_CORSO_DATA_PLANE_URL }} Publish-Image: - needs: [Test-Suite-Trusted, Linting, Website-Linting, SetEnv] + needs: [Test-Suite-Trusted, Source-Code-Linting, Website-Linting, SetEnv] environment: ${{ needs.SetEnv.outputs.environment }} runs-on: ubuntu-latest if: startsWith(github.ref, 'refs/tags/') @@ -568,7 +592,7 @@ jobs: ./corso.exe --version 2>&1 | grep -E "version: ${{ env.CORSO_VERSION }}$" Publish-Website-Test: - needs: [Test-Suite-Trusted, Linting, Website-Linting, SetEnv] + needs: [Test-Suite-Trusted, Source-Code-Linting, Website-Linting, SetEnv] environment: ${{ needs.SetEnv.outputs.environment }} runs-on: ubuntu-latest if: github.ref == 'refs/heads/main' diff --git a/.github/workflows/sanity-test.yaml b/.github/workflows/sanity-test.yaml index 4f5020e47..c2dcc4aaa 100644 --- a/.github/workflows/sanity-test.yaml +++ b/.github/workflows/sanity-test.yaml @@ -66,7 +66,7 @@ jobs: - name: Version Test run: | set -euo pipefail - if [ $( ./corso --version | grep 'Corso version:' | wc -l) -ne 1 ] + if [ $( ./corso --version | grep -c 'Corso version:' ) -ne 1 ] then echo "valid version not found" exit 1 @@ -78,7 +78,7 @@ jobs: TEST_RESULT: "test_results" run: | set -euo pipefail - prefix=`date +"%Y-%m-%d-%T"` + prefix=$(date +"%Y-%m-%d-%T") echo -e "\nRepo init test\n" >> ${CORSO_LOG_FILE} ./corso repo init s3 \ --no-stats \ @@ -266,7 +266,7 @@ jobs: AZURE_CLIENT_SECRET: ${{ secrets[needs.SetM365App.outputs.client_secret_env] }} AZURE_TENANT_ID: ${{ secrets.TENANT_ID }} run: | - suffix=`date +"%Y-%m-%d_%H-%M"` + suffix=$(date +"%Y-%m-%d_%H-%M") go run . onedrive files \ --user ${TEST_USER} \