From c129f28b16e199575eee88f5ef49473183f15643 Mon Sep 17 00:00:00 2001 From: Jarek Kowalski Date: Sat, 15 Jan 2022 12:12:18 -0800 Subject: [PATCH] chore(ci): moved tests to standalone GHA workflow that runs in parallel (#1663) --- .github/workflows/make.yml | 17 --------- .github/workflows/tests.yml | 70 +++++++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+), 17 deletions(-) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/make.yml b/.github/workflows/make.yml index 1b2f69e40..1f5778365 100644 --- a/.github/workflows/make.yml +++ b/.github/workflows/make.yml @@ -23,10 +23,6 @@ env: NON_TAG_RELEASE_REPO: ${{ secrets.NON_TAG_RELEASE_REPO }} # RPM and APT packages GCS bucket/hostname. PACKAGES_HOST: ${{ secrets.PACKAGES_HOST }} - # set (to any value other than false) to trigger random unicode filenames testing (logs may be difficult to read) - ENABLE_UNICODE_FILENAMES: ${{ secrets.ENABLE_UNICODE_FILENAMES }} - # set (to any value other than false) to trigger very long filenames testing - ENABLE_LONG_FILENAMES: ${{ secrets.ENABLE_LONG_FILENAMES }} jobs: build: strategy: @@ -97,19 +93,6 @@ jobs: # macOS signing certificate (base64-encoded), used by Electron Builder MACOS_SIGNING_IDENTITY: ${{ secrets.MACOS_SIGNING_IDENTITY }} - - name: Tests - run: make ci-tests - continue-on-error: ${{ github.event_name != 'pull_request' }} - - name: Integration Tests - run: make -j2 ci-integration-tests - continue-on-error: ${{ github.event_name != 'pull_request' }} - - name: Upload Logs - uses: actions/upload-artifact@v2 - with: - name: logs - path: .logs/**/*.log - if-no-files-found: ignore - if: ${{ always() }} - name: Upload Kopia Artifacts uses: actions/upload-artifact@v2 with: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 000000000..e8e3d5860 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,70 @@ +name: Tests +on: + pull_request: + branches: [ master ] + push: + # ci-sandbox is a branch dedicated to testing post-submit code. + branches: [ master, artifacts-pr ] + tags: + - v* + schedule: + # run on Mondays at 8AM + - cron: '0 8 * * 1' +env: + # environment variables shared between build steps + # do not include sensitive credentials and tokens here, instead pass them + # directly to tools that need them to limit the blast radius in case one of them + # becomes compromised and leaks credentials to external sites. + # required by Makefile + UNIX_SHELL_ON_WINDOWS: true + # set (to any value other than false) to trigger random unicode filenames testing (logs may be difficult to read) + ENABLE_UNICODE_FILENAMES: ${{ secrets.ENABLE_UNICODE_FILENAMES }} + # set (to any value other than false) to trigger very long filenames testing + ENABLE_LONG_FILENAMES: ${{ secrets.ENABLE_LONG_FILENAMES }} +jobs: + build: + strategy: + fail-fast: false + matrix: + os: [windows-latest, ubuntu-latest, macos-latest] + include: + - os: [self-hosted, ARM64] + - os: [self-hosted, ARMHF] + name: Tests + runs-on: ${{ matrix.os }} + continue-on-error: ${{ contains(matrix.os, 'self-hosted') }} + steps: + - name: Set up Go. + uses: actions/setup-go@v2 + with: + go-version: ^1.17 + id: go + if: ${{ !contains(matrix.os, 'ARMHF') }} + - name: Install GoLang for ARMHF + run: "echo /usr/local/go/bin >> $GITHUB_PATH; rm -rf /usr/local/go && mkdir -p /usr/local/go && curl -s -L https://golang.org/dl/go1.17.linux-armv6l.tar.gz | tar -C /usr/local -xz" + if: ${{ contains(matrix.os, 'ARMHF') }} + - name: Install Windows-specific packages + run: "choco install --no-progress -y make zip unzip curl" + if: ${{ contains(matrix.os, 'windows') }} + - name: Install macOS-specific packages + run: "sudo xcode-select -r" + if: ${{ contains(matrix.os, 'macos') }} + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Setup + run: make -j4 ci-setup + - name: Tests + run: make ci-tests + continue-on-error: ${{ github.event_name != 'pull_request' }} + - name: Integration Tests + run: make -j2 ci-integration-tests + continue-on-error: ${{ github.event_name != 'pull_request' }} + - name: Upload Logs + uses: actions/upload-artifact@v2 + with: + name: logs + path: .logs/**/*.log + if-no-files-found: ignore + if: ${{ always() }}