From 797ce137939f741896dd44cd94e5373d51994772 Mon Sep 17 00:00:00 2001 From: per1234 Date: Mon, 9 Aug 2021 21:02:55 -0700 Subject: [PATCH 1/2] Fix typo in integration test workflow comment --- .github/workflows/test-integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-integration.yml b/.github/workflows/test-integration.yml index afd36447..d27f4449 100644 --- a/.github/workflows/test-integration.yml +++ b/.github/workflows/test-integration.yml @@ -57,7 +57,7 @@ jobs: BINDIR="$ARDUINO_LINT_INSTALLATION_PATH" \ sh - # Add installation folder to path to path + # Add installation folder to path echo "$ARDUINO_LINT_INSTALLATION_PATH" >> "$GITHUB_PATH" - name: Install Taskfile From 3815951610cb2cc307c035b3824d38d475686db2 Mon Sep 17 00:00:00 2001 From: per1234 Date: Mon, 9 Aug 2021 21:04:57 -0700 Subject: [PATCH 2/2] Allow specifying Arduino Lint ref for manual run of integration test When triggered automatically by a push, PR, or schedule event, the integration test uses the latest release of Arduino Lint. That is the same version used by the production engine, so appropriate for testing development on the engine. However, the integration of Arduino Lint into the engine should also be tested before a new version is released to be immediately used by the production engine. This will be made easier by allowing the integration test to be run via a manual trigger of GitHub Actions, specifying any arbitrary Git ref of the Arduino Lint repository to build from. --- .github/workflows/test-integration.yml | 34 ++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-integration.yml b/.github/workflows/test-integration.yml index d27f4449..4167b723 100644 --- a/.github/workflows/test-integration.yml +++ b/.github/workflows/test-integration.yml @@ -23,12 +23,19 @@ on: - "pyproject.toml" - "test/**" workflow_dispatch: + inputs: + arduino-lint-ref: + description: Arduino Lint ref (leave empty for latest release) + default: "" repository_dispatch: jobs: test: runs-on: ubuntu-latest + env: + ARDUINO_LINT_SOURCE_PATH: arduino-lint + steps: - name: Checkout repository uses: actions/checkout@v2 @@ -46,7 +53,14 @@ jobs: - name: Install Poetry run: pip install poetry - - name: Install Arduino Lint + - name: Install Taskfile + uses: arduino/setup-task@v1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + version: 3.x + + - name: Install latest release of Arduino Lint + if: github.event.inputs.arduino-lint-ref == '' run: | ARDUINO_LINT_INSTALLATION_PATH="${{ runner.temp }}/arduino-lint" mkdir --parents "$ARDUINO_LINT_INSTALLATION_PATH" @@ -60,11 +74,21 @@ jobs: # Add installation folder to path echo "$ARDUINO_LINT_INSTALLATION_PATH" >> "$GITHUB_PATH" - - name: Install Taskfile - uses: arduino/setup-task@v1 + - name: Checkout Arduino Lint repository + if: github.event.inputs.arduino-lint-ref != '' + uses: actions/checkout@v2 with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - version: 3.x + repository: arduino/arduino-lint + ref: ${{ github.event.inputs.arduino-lint-ref }} + path: ${{ env.ARDUINO_LINT_SOURCE_PATH }} + + - name: Build Arduino Lint + if: github.event.inputs.arduino-lint-ref != '' + working-directory: ${{ env.ARDUINO_LINT_SOURCE_PATH }} + run: | + task build + # Add installation folder to path + echo "$PWD" >> "$GITHUB_PATH" - name: Run integration tests run: task go:test-integration