ashmrtn f27c3e0b83
Don't hide tests output, update archiver (#950)
## Description

<!-- Insert PR description-->

## Type of change

<!--- Please check the type of change your PR introduces: --->
- [ ] 🌻 Feature
- [ ] 🐛 Bugfix
- [ ] 🗺️ Documentation
- [ ] 🤖 Test
- [x] 💻 CI/Deployment
- [ ] 🐹 Trivial/Minor

## Issue(s)

<!-- Can reference multiple issues. Use one of the following "magic words" - "closes, fixes" to auto-close the Github issue. -->
* #<issue>

## Test Plan

<!-- How will this be tested prior to merging.-->
- [ ] 💪 Manual
- [ ]  Unit test
- [ ] 💚 E2E
2022-09-27 13:37:25 +00:00

135 lines
4.7 KiB
YAML

name: CI Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
# required to retrieve AWS credentials
id-token: write
contents: read
pull-requests: read
# cancel currently running jobs if a new version of the branch is pushed
concurrency:
group: ci-linting-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# ----------------------------------------------------------------------------------------------------
# --- Prechecks and Checkouts ------------------------------------------------------------------------
# ----------------------------------------------------------------------------------------------------
precheck:
uses: alcionai/corso/.github/workflows/_filechange_checker.yml@main
checkout:
needs: precheck
environment: Testing
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# single setup and sum cache handling here.
# the results will cascade onto both testing and linting.
- name: Setup Golang with cache
if: needs.precheck.outputs.fileschanged == 'true'
uses: magnetikonline/action-golang-cache@v3
with:
go-version-file: src/go.mod
# ----------------------------------------------------------------------------------------------------
# --- Integration and Unit Testing -------------------------------------------------------------------
# ----------------------------------------------------------------------------------------------------
Test-Suite:
needs: [precheck, checkout]
environment: Testing
runs-on: ubuntu-latest
defaults:
run:
working-directory: src
steps:
- uses: actions/checkout@v3
- name: Setup Golang with cache
if: needs.precheck.outputs.fileschanged == 'true'
uses: magnetikonline/action-golang-cache@v3
with:
go-version-file: src/go.mod
# Install gotestfmt
- name: Set up gotestfmt
if: needs.precheck.outputs.fileschanged == 'true'
run: go install github.com/haveyoudebuggedit/gotestfmt/v2/cmd/gotestfmt@latest
# AWS creds
- name: Configure AWS credentials from Test account
if: needs.precheck.outputs.fileschanged == 'true'
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: arn:aws:iam::951767375776:role/corso-testing-role
role-session-name: integration-testing
aws-region: us-east-1
# run the tests
- name: Integration Tests
if: needs.precheck.outputs.fileschanged == 'true'
env:
CLIENT_ID: ${{ secrets.CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
CORSO_CI_TESTS: true
CORSO_M356_TEST_USER_ID: ${{ secrets.CORSO_M356_TEST_USER_ID }}
CORSO_PASSPHRASE: ${{ secrets.INTEGRATION_TEST_CORSO_PASSPHRASE }}
RUDDERSTACK_CORSO_WRITE_KEY: ${{ secrets.RUDDERSTACK_CORSO_WRITE_KEY }}
RUDDERSTACK_CORSO_DATA_PLANE_URL: ${{ secrets.RUDDERSTACK_CORSO_DATA_PLANE_URL }}
TENANT_ID: ${{ secrets.TENANT_ID }}
run: |
set -euo pipefail
go test -json -v ./... 2>&1 | tee /tmp/gotest.log | gotestfmt
# Upload the original go test log as an artifact for later review.
- name: Upload test log
if: needs.precheck.outputs.fileschanged == 'true'
uses: actions/upload-artifact@v3
with:
name: test-log
path: /tmp/gotest.log
if-no-files-found: error
# ----------------------------------------------------------------------------------------------------
# --- Source Code Linting ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------------------------------
Linting:
needs: [precheck, checkout]
environment: Testing
runs-on: ubuntu-latest
defaults:
run:
working-directory: src
steps:
- uses: actions/checkout@v3
- name: Setup Golang with cache
if: needs.precheck.outputs.fileschanged == 'true'
uses: magnetikonline/action-golang-cache@v3
with:
go-version-file: src/go.mod
- name: Go Lint
if: needs.precheck.outputs.fileschanged == 'true'
uses: golangci/golangci-lint-action@v3.2.0
with:
version: v1.45.2
working-directory: ./src
# check licenses
- name: Get go-licenses
if: needs.precheck.outputs.fileschanged == 'true'
run: go install github.com/google/go-licenses@latest
- name: Run go-licenses
if: needs.precheck.outputs.fileschanged == 'true'
run: go-licenses check github.com/alcionai/corso/src --ignore github.com/alcionai/corso/src