Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 3 to 4. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/golangci/golangci-lint-action/releases">golangci/golangci-lint-action's releases</a>.</em></p> <blockquote> <h2>v4.0.0</h2> <!-- raw HTML omitted --> <h2>What's Changed</h2> <h3>Documentation</h3> <ul> <li>docs: update examples by <a href="https://github.com/KunalSin9h"><code>@KunalSin9h</code></a> in <a href="https://redirect.github.com/golangci/golangci-lint-action/pull/826">golangci/golangci-lint-action#826</a></li> <li>docs: update section about GitHub Annotations by <a href="https://github.com/JustinDFuller"><code>@JustinDFuller</code></a> in <a href="https://redirect.github.com/golangci/golangci-lint-action/pull/931">golangci/golangci-lint-action#931</a></li> </ul> <h3>Dependencies</h3> <ul> <li>build(deps-dev): bump <code>@typescript-eslint/eslint-plugin</code> from 6.3.0 to 6.4.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/golangci/golangci-lint-action/pull/829">golangci/golangci-lint-action#829</a></li> <li>build(deps-dev): bump eslint-plugin-import from 2.28.0 to 2.28.1 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/golangci/golangci-lint-action/pull/830">golangci/golangci-lint-action#830</a></li> <li>build(deps): bump <code>@types/node</code> from 20.5.0 to 20.5.1 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/golangci/golangci-lint-action/pull/827">golangci/golangci-lint-action#827</a></li> <li>build(deps-dev): bump <code>@typescript-eslint/parser</code> from 6.3.0 to 6.4.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/golangci/golangci-lint-action/pull/831">golangci/golangci-lint-action#831</a></li> <li>build(deps-dev): bump prettier from 3.0.1 to 3.0.2 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/golangci/golangci-lint-action/pull/828">golangci/golangci-lint-action#828</a></li> <li>build(deps): bump <code>@types/node</code> from 20.5.1 to 20.5.7 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/golangci/golangci-lint-action/pull/833">golangci/golangci-lint-action#833</a></li> <li>build(deps-dev): bump <code>@typescript-eslint/eslint-plugin</code> from 6.4.0 to 6.4.1 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/golangci/golangci-lint-action/pull/834">golangci/golangci-lint-action#834</a></li> <li>build(deps-dev): bump <code>@typescript-eslint/parser</code> from 6.4.0 to 6.4.1 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/golangci/golangci-lint-action/pull/835">golangci/golangci-lint-action#835</a></li> <li>build(deps-dev): bump eslint from 8.47.0 to 8.48.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/golangci/golangci-lint-action/pull/837">golangci/golangci-lint-action#837</a></li> <li>build(deps-dev): bump typescript from 5.1.6 to 5.2.2 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/golangci/golangci-lint-action/pull/836">golangci/golangci-lint-action#836</a></li> <li>build(deps): bump <code>@types/semver</code> from 7.5.0 to 7.5.1 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/golangci/golangci-lint-action/pull/838">golangci/golangci-lint-action#838</a></li> <li>build(deps-dev): bump <code>@typescript-eslint/eslint-plugin</code> from 6.4.1 to 6.5.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/golangci/golangci-lint-action/pull/839">golangci/golangci-lint-action#839</a></li> <li>build(deps-dev): bump prettier from 3.0.2 to 3.0.3 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/golangci/golangci-lint-action/pull/842">golangci/golangci-lint-action#842</a></li> <li>build(deps-dev): bump <code>@typescript-eslint/parser</code> from 6.4.1 to 6.5.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/golangci/golangci-lint-action/pull/840">golangci/golangci-lint-action#840</a></li> <li>build(deps): bump <code>@types/node</code> from 20.5.7 to 20.5.9 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/golangci/golangci-lint-action/pull/841">golangci/golangci-lint-action#841</a></li> <li>chore: bump to use node20 runtime, actions/checkout to v4 by <a href="https://github.com/chenrui333"><code>@chenrui333</code></a> in <a href="https://redirect.github.com/golangci/golangci-lint-action/pull/843">golangci/golangci-lint-action#843</a></li> <li>build(deps): bump actions/checkout from 3 to 4 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/golangci/golangci-lint-action/pull/845">golangci/golangci-lint-action#845</a></li> <li>build(deps-dev): bump eslint from 8.48.0 to 8.49.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/golangci/golangci-lint-action/pull/846">golangci/golangci-lint-action#846</a></li> <li>build(deps): bump <code>@types/node</code> from 20.5.9 to 20.6.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/golangci/golangci-lint-action/pull/847">golangci/golangci-lint-action#847</a></li> <li>build(deps-dev): bump <code>@typescript-eslint/parser</code> from 6.5.0 to 6.6.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/golangci/golangci-lint-action/pull/848">golangci/golangci-lint-action#848</a></li> <li>build(deps-dev): bump <code>@vercel/ncc</code> from 0.36.1 to 0.38.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/golangci/golangci-lint-action/pull/850">golangci/golangci-lint-action#850</a></li> <li>build(deps-dev): bump <code>@typescript-eslint/eslint-plugin</code> from 6.5.0 to 6.6.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/golangci/golangci-lint-action/pull/849">golangci/golangci-lint-action#849</a></li> <li>build(deps): bump <code>@types/semver</code> from 7.5.1 to 7.5.2 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/golangci/golangci-lint-action/pull/853">golangci/golangci-lint-action#853</a></li> <li>build(deps): bump <code>@types/tmp</code> from 0.2.3 to 0.2.4 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/golangci/golangci-lint-action/pull/854">golangci/golangci-lint-action#854</a></li> <li>build(deps-dev): bump <code>@typescript-eslint/eslint-plugin</code> from 6.6.0 to 6.7.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/golangci/golangci-lint-action/pull/855">golangci/golangci-lint-action#855</a></li> <li>build(deps): bump <code>@types/node</code> from 20.6.0 to 20.6.2 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/golangci/golangci-lint-action/pull/857">golangci/golangci-lint-action#857</a></li> <li>build(deps): bump <code>@actions/core</code> from 1.10.0 to 1.10.1 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/golangci/golangci-lint-action/pull/856">golangci/golangci-lint-action#856</a></li> <li>build(deps-dev): bump eslint from 8.49.0 to 8.50.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/golangci/golangci-lint-action/pull/859">golangci/golangci-lint-action#859</a></li> <li>build(deps): bump <code>@types/node</code> from 20.6.2 to 20.6.5 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/golangci/golangci-lint-action/pull/860">golangci/golangci-lint-action#860</a></li> <li>build(deps-dev): bump <code>@typescript-eslint/parser</code> from 6.6.0 to 6.7.2 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/golangci/golangci-lint-action/pull/861">golangci/golangci-lint-action#861</a></li> <li>build(deps-dev): bump <code>@typescript-eslint/eslint-plugin</code> from 6.7.0 to 6.7.2 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/golangci/golangci-lint-action/pull/862">golangci/golangci-lint-action#862</a></li> <li>build(deps): bump <code>@types/semver</code> from 7.5.2 to 7.5.3 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/golangci/golangci-lint-action/pull/864">golangci/golangci-lint-action#864</a></li> <li>build(deps-dev): bump <code>@typescript-eslint/eslint-plugin</code> from 6.7.2 to 6.7.3 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/golangci/golangci-lint-action/pull/865">golangci/golangci-lint-action#865</a></li> <li>build(deps): bump <code>@types/node</code> from 20.6.5 to 20.8.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/golangci/golangci-lint-action/pull/867">golangci/golangci-lint-action#867</a></li> <li>build(deps-dev): bump <code>@typescript-eslint/parser</code> from 6.7.2 to 6.7.3 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/golangci/golangci-lint-action/pull/866">golangci/golangci-lint-action#866</a></li> <li>build(deps-dev): bump <code>@typescript-eslint/parser</code> from 6.7.3 to 6.7.4 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/golangci/golangci-lint-action/pull/868">golangci/golangci-lint-action#868</a></li> <li>build(deps): bump <code>@types/node</code> from 20.8.0 to 20.8.3 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/golangci/golangci-lint-action/pull/869">golangci/golangci-lint-action#869</a></li> <li>build(deps-dev): bump <code>@typescript-eslint/eslint-plugin</code> from 6.7.3 to 6.7.4 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/golangci/golangci-lint-action/pull/870">golangci/golangci-lint-action#870</a></li> <li>build(deps-dev): bump eslint from 8.50.0 to 8.51.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/golangci/golangci-lint-action/pull/871">golangci/golangci-lint-action#871</a></li> <li>build(deps): bump <code>@actions/http-client</code> from 2.1.1 to 2.2.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/golangci/golangci-lint-action/pull/872">golangci/golangci-lint-action#872</a></li> <li>build(deps-dev): bump <code>@typescript-eslint/parser</code> from 6.7.4 to 6.7.5 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/golangci/golangci-lint-action/pull/874">golangci/golangci-lint-action#874</a></li> <li>build(deps): bump <code>@types/node</code> from 20.8.3 to 20.8.6 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/golangci/golangci-lint-action/pull/875">golangci/golangci-lint-action#875</a></li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="3cfe3a4abb"><code>3cfe3a4</code></a> build(deps): bump <code>@actions/cache</code> from 3.2.3 to 3.2.4 (<a href="https://redirect.github.com/golangci/golangci-lint-action/issues/963">#963</a>)</li> <li><a href="cbc59cf0d1"><code>cbc59cf</code></a> build(deps-dev): bump prettier from 3.2.4 to 3.2.5 (<a href="https://redirect.github.com/golangci/golangci-lint-action/issues/960">#960</a>)</li> <li><a href="459a04b021"><code>459a04b</code></a> build(deps-dev): bump <code>@typescript-eslint/eslint-plugin</code> from 6.19.1 to 6.20.0 ...</li> <li><a href="e2315b67db"><code>e2315b6</code></a> build(deps-dev): bump <code>@typescript-eslint/parser</code> from 6.19.1 to 6.20.0 (<a href="https://redirect.github.com/golangci/golangci-lint-action/issues/961">#961</a>)</li> <li><a href="d6173a45d0"><code>d6173a4</code></a> build(deps): bump <code>@types/node</code> from 20.11.10 to 20.11.16 (<a href="https://redirect.github.com/golangci/golangci-lint-action/issues/962">#962</a>)</li> <li><a href="0e8f5bf773"><code>0e8f5bf</code></a> build(deps): bump <code>@types/node</code> from 20.11.5 to 20.11.10 (<a href="https://redirect.github.com/golangci/golangci-lint-action/issues/958">#958</a>)</li> <li><a href="349d20632d"><code>349d206</code></a> build(deps-dev): bump <code>@typescript-eslint/eslint-plugin</code> from 6.19.0 to 6.19.1 ...</li> <li><a href="2221aee284"><code>2221aee</code></a> build(deps-dev): bump <code>@typescript-eslint/parser</code> from 6.18.1 to 6.19.1 (<a href="https://redirect.github.com/golangci/golangci-lint-action/issues/954">#954</a>)</li> <li><a href="3b44ae5b24"><code>3b44ae5</code></a> build(deps-dev): bump <code>@typescript-eslint/eslint-plugin</code> from 6.18.1 to 6.19.0 ...</li> <li><a href="323b871bbc"><code>323b871</code></a> build(deps-dev): bump prettier from 3.2.2 to 3.2.4 (<a href="https://redirect.github.com/golangci/golangci-lint-action/issues/950">#950</a>)</li> <li>Additional commits viewable in <a href="https://github.com/golangci/golangci-lint-action/compare/v3...v4">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) You can trigger a rebase of this PR by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details>
766 lines
30 KiB
YAML
766 lines
30 KiB
YAML
name: Build/Release Corso
|
|
env:
|
|
IMAGE_NAME: ghcr.io/alcionai/corso
|
|
on:
|
|
workflow_dispatch:
|
|
|
|
pull_request:
|
|
|
|
push:
|
|
branches: [main]
|
|
tags: ["v*.*.*"]
|
|
|
|
repository_dispatch:
|
|
types: [ok-to-test-command]
|
|
|
|
permissions:
|
|
# required to retrieve AWS credentials
|
|
id-token: write
|
|
contents: write
|
|
packages: write
|
|
pull-requests: read
|
|
|
|
# cancel currently running jobs if a new version of the branch is pushed
|
|
concurrency:
|
|
group: ci-${{ 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
|
|
defaults:
|
|
run:
|
|
working-directory: src
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
# single setup and sum cache handling here.
|
|
# the results will cascade onto both testing and linting.
|
|
- name: Setup Golang with cache
|
|
uses: ./.github/actions/go-setup-cache
|
|
if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main' || needs.precheck.outputs.websitefileschanged == 'true'
|
|
with:
|
|
go-version-file: src/go.mod
|
|
|
|
# SetM365App will decide which M365 app to use for this CI run
|
|
SetM365App:
|
|
uses: alcionai/corso/.github/workflows/accSelector.yaml@main
|
|
|
|
SetEnv:
|
|
environment: Testing
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
environment: ${{ steps.environment.outputs.environment }}
|
|
version: ${{ steps.version.outputs.version }}
|
|
website-bucket: ${{ steps.website-bucket.outputs.website-bucket }}
|
|
website-cfid: ${{ steps.website-cfid.outputs.website-cfid }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Figure out environment
|
|
id: environment
|
|
run: |
|
|
if ${{ startsWith(github.ref, 'refs/tags/') }}; then
|
|
echo "environment=Production" | tee -a $GITHUB_OUTPUT
|
|
else
|
|
echo "environment=Testing" | tee -a $GITHUB_OUTPUT
|
|
fi
|
|
|
|
- name: Get version string
|
|
id: version
|
|
run: |
|
|
if ${{ startsWith(github.ref, 'refs/tags/') }}; then
|
|
echo "version=$(git describe --exact-match --tags $(git rev-parse HEAD))" | tee -a $GITHUB_OUTPUT
|
|
else
|
|
echo "version=$(echo unreleased-$(git rev-parse --short HEAD))" | tee -a $GITHUB_OUTPUT
|
|
fi
|
|
|
|
- name: Get bucket name for website
|
|
id: website-bucket
|
|
run: |
|
|
if ${{ startsWith(github.ref, 'refs/tags/') }}; then
|
|
echo "website-bucket=corsobackup.io" | tee -a $GITHUB_OUTPUT
|
|
else
|
|
echo "website-bucket=test-corso-docs" | tee -a $GITHUB_OUTPUT
|
|
fi
|
|
|
|
- name: Get cfid for website
|
|
id: website-cfid
|
|
run: |
|
|
if ${{ startsWith(github.ref, 'refs/tags/') }}; then
|
|
echo "website-cfid=E1W9NGI9YTVZ1A" | tee -a $GITHUB_OUTPUT
|
|
else
|
|
echo "website-cfid=ESFTEIYTIP7Y3" | tee -a $GITHUB_OUTPUT
|
|
fi
|
|
|
|
|
|
# ----------------------------------------------------------------------------------------------------
|
|
# --- Website Linting -----------------------------------------------------------------------------------
|
|
# ----------------------------------------------------------------------------------------------------
|
|
|
|
Website-Linting:
|
|
needs: [Precheck, Checkout, SetEnv]
|
|
environment: Testing
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 30
|
|
if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main' || needs.precheck.outputs.websitefileschanged == 'true' # websitefileschanged also includes srcfileschanged
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Lint Website
|
|
uses: ./.github/actions/website-linting
|
|
with:
|
|
version: ${{ needs.SetEnv.outputs.version }}
|
|
|
|
# ----------------------------------------------------------------------------------------------------
|
|
# --- Integration and Unit Testing -------------------------------------------------------------------
|
|
# ----------------------------------------------------------------------------------------------------
|
|
|
|
Test-Suite-Trusted:
|
|
needs: [Precheck, Checkout, SetM365App]
|
|
environment: Testing
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 120
|
|
if: (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main') || (needs.precheck.outputs.srcfileschanged == 'true' && github.event.pull_request.head.repo.full_name == github.repository)
|
|
defaults:
|
|
run:
|
|
working-directory: src
|
|
env:
|
|
# Resolve the name of the secret that contains the Azure client ID/secret
|
|
AZURE_CLIENT_ID_NAME: ${{ needs.SetM365App.outputs.client_id_env }}
|
|
AZURE_CLIENT_SECRET_NAME: ${{ needs.SetM365App.outputs.client_secret_env }}
|
|
CLIENT_APP_SLOT: ${{ needs.SetM365App.outputs.client_app_slot }}
|
|
CORSO_LOG_FILE: ${{ github.workspace }}/src/testlog/run-ci.log
|
|
LOG_GRAPH_REQUESTS: true
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup Golang with cache
|
|
uses: magnetikonline/action-golang-cache@v4
|
|
with:
|
|
go-version-file: src/go.mod
|
|
|
|
- run: mkdir testlog
|
|
|
|
# Install gotestfmt
|
|
- name: Set up gotestfmt
|
|
run: go install github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@latest
|
|
|
|
# AWS creds
|
|
- name: Configure AWS credentials from Test account
|
|
uses: aws-actions/configure-aws-credentials@v4
|
|
with:
|
|
role-to-assume: ${{ secrets.AWS_IAM_ROLE }}
|
|
role-session-name: integration-testing
|
|
aws-region: us-east-1
|
|
|
|
# run the tests
|
|
- name: Integration Tests
|
|
env:
|
|
AZURE_CLIENT_ID: ${{ secrets[env.AZURE_CLIENT_ID_NAME] }}
|
|
AZURE_CLIENT_SECRET: ${{ secrets[env.AZURE_CLIENT_SECRET_NAME] }}
|
|
AZURE_TENANT_ID: ${{ secrets.TENANT_ID }}
|
|
CORSO_CI_TESTS: true
|
|
CORSO_M365_TEST_USER_ID: ${{ vars.CORSO_M365_TEST_USER_ID }}
|
|
CORSO_SECONDARY_M365_TEST_USER_ID: ${{ vars.CORSO_SECONDARY_M365_TEST_USER_ID }}
|
|
CORSO_PASSPHRASE: ${{ secrets.INTEGRATION_TEST_CORSO_PASSPHRASE }}
|
|
S3_BUCKET: ${{ secrets.CI_TESTS_S3_BUCKET }}
|
|
run: |
|
|
set -euo pipefail
|
|
go test \
|
|
-tags testing \
|
|
-json \
|
|
-v \
|
|
-failfast \
|
|
-p 1 \
|
|
-timeout 20m \
|
|
./... \
|
|
2>&1 | tee ./testlog/gotest-ci.log | gotestfmt -hide successful-tests
|
|
|
|
# Upload the original go test output as an artifact for later review.
|
|
- name: Upload test log
|
|
if: failure()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ci-test-log
|
|
path: src/testlog/*
|
|
if-no-files-found: error
|
|
retention-days: 14
|
|
|
|
Retention-Test-Suite-Trusted:
|
|
needs: [Precheck, Checkout, SetM365App]
|
|
environment: Testing
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 30
|
|
if: (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main') || (needs.precheck.outputs.srcfileschanged == 'true' && github.event.pull_request.head.repo.full_name == github.repository)
|
|
defaults:
|
|
run:
|
|
working-directory: src
|
|
env:
|
|
# Resolve the name of the secret that contains the Azure client ID/secret
|
|
AZURE_CLIENT_ID_NAME: ${{ needs.SetM365App.outputs.client_id_env }}
|
|
AZURE_CLIENT_SECRET_NAME: ${{ needs.SetM365App.outputs.client_secret_env }}
|
|
CLIENT_APP_SLOT: ${{ needs.SetM365App.outputs.client_app_slot }}
|
|
CORSO_LOG_FILE: ${{ github.workspace }}/src/testlog/run-ci-retention.log
|
|
LOG_GRAPH_REQUESTS: true
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup Golang with cache
|
|
uses: magnetikonline/action-golang-cache@v4
|
|
with:
|
|
go-version-file: src/go.mod
|
|
|
|
- run: mkdir testlog
|
|
|
|
# Install gotestfmt
|
|
- name: Set up gotestfmt
|
|
run: go install github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@latest
|
|
|
|
# AWS creds
|
|
- name: Configure AWS credentials from Test account
|
|
uses: aws-actions/configure-aws-credentials@v4
|
|
with:
|
|
role-to-assume: ${{ secrets.AWS_IAM_ROLE }}
|
|
role-session-name: integration-testing
|
|
aws-region: us-east-1
|
|
|
|
# run the tests
|
|
- name: Retention Tests
|
|
env:
|
|
AZURE_CLIENT_ID: ${{ secrets[env.AZURE_CLIENT_ID_NAME] }}
|
|
AZURE_CLIENT_SECRET: ${{ secrets[env.AZURE_CLIENT_SECRET_NAME] }}
|
|
AZURE_TENANT_ID: ${{ secrets.TENANT_ID }}
|
|
CORSO_RETENTION_TESTS: true
|
|
CORSO_M365_TEST_USER_ID: ${{ vars.CORSO_M365_TEST_USER_ID }}
|
|
CORSO_SECONDARY_M365_TEST_USER_ID: ${{ vars.CORSO_SECONDARY_M365_TEST_USER_ID }}
|
|
CORSO_PASSPHRASE: ${{ secrets.INTEGRATION_TEST_CORSO_PASSPHRASE }}
|
|
S3_BUCKET: ${{ secrets.CI_RETENTION_TESTS_S3_BUCKET }}
|
|
run: |
|
|
set -euo pipefail
|
|
go test \
|
|
-tags testing \
|
|
-json \
|
|
-v \
|
|
-failfast \
|
|
-p 1 \
|
|
-timeout 10m \
|
|
./... \
|
|
2>&1 | tee ./testlog/gotest-ci.log | gotestfmt -hide successful-tests
|
|
|
|
# Upload the original go test output as an artifact for later review.
|
|
- name: Upload test log
|
|
if: failure()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ci-retention-test-log
|
|
path: src/testlog/*
|
|
if-no-files-found: error
|
|
retention-days: 14
|
|
|
|
Unit-Test-Suite:
|
|
needs: [Precheck, Checkout]
|
|
environment: Testing
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 30
|
|
if: needs.precheck.outputs.srcfileschanged == 'true'
|
|
defaults:
|
|
run:
|
|
working-directory: src
|
|
env:
|
|
CORSO_LOG_FILE: ${{ github.workspace }}/src/testlog/run-unit.log
|
|
LOG_GRAPH_REQUESTS: true
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup Golang with cache
|
|
uses: magnetikonline/action-golang-cache@v4
|
|
with:
|
|
go-version-file: src/go.mod
|
|
|
|
- run: mkdir testlog
|
|
|
|
# Install gotestfmt
|
|
- name: Set up gotestfmt
|
|
run: go install github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@latest
|
|
|
|
# run the tests
|
|
- name: Unit Tests
|
|
env:
|
|
# Set these to a bad value so we don't accidentally fall back to
|
|
# something elsewhere.
|
|
CORSO_M365_TEST_USER_ID: 'foo'
|
|
CORSO_SECONDARY_M365_TEST_USER_ID: 'foo'
|
|
run: |
|
|
set -euo pipefail
|
|
go test \
|
|
-tags testing \
|
|
-json \
|
|
-v \
|
|
-failfast \
|
|
-p 1 \
|
|
-timeout 20m \
|
|
./... \
|
|
2>&1 | tee ./testlog/gotest-unit.log | gotestfmt -hide successful-tests
|
|
|
|
# Upload the original go test output as an artifact for later review.
|
|
- name: Upload test log
|
|
if: failure()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: unit-test-log
|
|
path: src/testlog/*
|
|
if-no-files-found: error
|
|
retention-days: 14
|
|
|
|
Test-Suite-Fork:
|
|
needs: [Precheck]
|
|
environment: Testing
|
|
if: (!startsWith(github.ref , 'refs/tags/') && github.ref != 'refs/heads/main') && (needs.precheck.outputs.srcfileschanged == 'true' && github.event.pull_request.head.repo.full_name != github.repository)
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: src
|
|
env:
|
|
CORSO_LOG_FILE: ${{ github.workspace }}/testlog/run-fork.log
|
|
LOG_GRAPH_REQUESTS: true
|
|
steps:
|
|
- name: Fail check if not repository_dispatch
|
|
if: github.event_name != 'repository_dispatch'
|
|
run: |
|
|
echo "Workflow requires approval from a maintainer to run. It will be automatically rerun on approval."
|
|
exit 1
|
|
|
|
- uses: marocchino/sticky-pull-request-comment@v2
|
|
if: github.event.client_payload.slash_command.args.named.sha != '' && contains(github.event.client_payload.pull_request.head.sha, github.event.client_payload.slash_command.args.named.sha)
|
|
with:
|
|
message: |
|
|
Workflow run sha specified via `ok-to-test` is not the latest commit on PR. Run canceled.
|
|
|
|
- name: Fail check if not head of PR
|
|
if: github.event.client_payload.slash_command.args.named.sha != '' && contains(github.event.client_payload.pull_request.head.sha, github.event.client_payload.slash_command.args.named.sha)
|
|
run: |
|
|
echo "Workflow run sha specified is not the latest commit on PR. Exiting."
|
|
exit 1
|
|
|
|
# add comment to PR with link to workflow run
|
|
- uses: marocchino/sticky-pull-request-comment@v2
|
|
with:
|
|
message: |
|
|
Test suite run will be available at https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID
|
|
|
|
# Check out merge commit
|
|
- name: Fork based /ok-to-test checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: "refs/pull/${{ github.event.client_payload.pull_request.number }}/merge"
|
|
|
|
- name: Setup Golang with cache
|
|
uses: magnetikonline/action-golang-cache@v4
|
|
with:
|
|
go-version-file: src/go.mod
|
|
|
|
- run: mkdir testlog
|
|
|
|
# Install gotestfmt
|
|
- name: Set up gotestfmt
|
|
run: go install github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@latest
|
|
|
|
# AWS creds
|
|
- name: Configure AWS credentials from Test account
|
|
uses: aws-actions/configure-aws-credentials@v4
|
|
with:
|
|
role-to-assume: ${{ secrets.AWS_IAM_ROLE }}
|
|
role-session-name: integration-testing
|
|
aws-region: us-east-1
|
|
|
|
# run the tests
|
|
- name: Integration Tests
|
|
env:
|
|
AZURE_CLIENT_ID: ${{ secrets.CLIENT_ID }}
|
|
AZURE_CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
|
|
AZURE_TENANT_ID: ${{ secrets.TENANT_ID }}
|
|
CORSO_CI_TESTS: true
|
|
CORSO_M365_TEST_USER_ID: ${{ vars.CORSO_M365_TEST_USER_ID }}
|
|
CORSO_PASSPHRASE: ${{ secrets.INTEGRATION_TEST_CORSO_PASSPHRASE }}
|
|
run: |
|
|
set -euo pipefail
|
|
go test \
|
|
-json \
|
|
-v \
|
|
-timeout 15m \
|
|
./... \
|
|
2>&1 | tee ./testlog/gotest-fork.log | gotestfmt -hide successful-tests
|
|
|
|
# Upload the original go test log as an artifact for later review.
|
|
- name: Upload test log
|
|
if: failure()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: fork-test-log
|
|
path: src/testlog/*
|
|
if-no-files-found: error
|
|
retention-days: 14
|
|
|
|
# Update check run called "Test-Suite-Fork"
|
|
- uses: actions/github-script@v7
|
|
id: update-check-run
|
|
if: failure()
|
|
env:
|
|
number: ${{ github.event.client_payload.pull_request.number }}
|
|
job: ${{ github.job }}
|
|
# Conveniently, job.status maps to https://developer.github.com/v3/checks/runs/#update-a-check-run
|
|
conclusion: ${{ job.status }}
|
|
with:
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
script: |
|
|
const { data: pull } = await github.rest.pulls.get({
|
|
...context.repo,
|
|
pull_number: process.env.number
|
|
});
|
|
const ref = pull.head.sha;
|
|
const { data: checks } = await github.rest.checks.listForRef({
|
|
...context.repo,
|
|
ref
|
|
});
|
|
const check = checks.check_runs.filter(c => c.name === process.env.job);
|
|
const { data: result } = await github.rest.checks.update({
|
|
...context.repo,
|
|
check_run_id: check[0].id,
|
|
status: 'completed',
|
|
conclusion: process.env.conclusion
|
|
});
|
|
return result;
|
|
|
|
# ----------------------------------------------------------------------------------------------------
|
|
# --- Source Code Linting ----------------------------------------------------------------------------
|
|
# ----------------------------------------------------------------------------------------------------
|
|
|
|
Source-Code-Linting:
|
|
needs: [Precheck, Checkout]
|
|
environment: Testing
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 30
|
|
if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main' || needs.precheck.outputs.srcfileschanged == 'true'
|
|
defaults:
|
|
run:
|
|
working-directory: src
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup Golang with cache
|
|
uses: magnetikonline/action-golang-cache@v4
|
|
with:
|
|
go-version-file: src/go.mod
|
|
|
|
- name: Go Lint
|
|
uses: golangci/golangci-lint-action@v4
|
|
with:
|
|
# Keep pinned to a verson as sometimes updates will add new lint
|
|
# failures in unchanged code.
|
|
version: v1.54.2
|
|
working-directory: src
|
|
skip-pkg-cache: true
|
|
skip-build-cache: true
|
|
|
|
# check licenses
|
|
- name: Get go-licenses
|
|
run: go install github.com/google/go-licenses@latest
|
|
|
|
- name: Run go-licenses
|
|
run: go-licenses check github.com/alcionai/corso/src --ignore github.com/alcionai/corso/src
|
|
|
|
- name: Run staticcheck
|
|
uses: dominikh/staticcheck-action@v1.3.0
|
|
with:
|
|
install-go: false
|
|
working-directory: src
|
|
|
|
- name: Run allowtags
|
|
run: |
|
|
go install github.com/ashmrtn/allowtags@latest
|
|
allowtags --allow-key json --allow-key uriparametername ./...
|
|
|
|
# I could not find a way to install tree-grepper without nix
|
|
# https://github.com/BrianHicks/tree-grepper/issues/293
|
|
- uses: cachix/install-nix-action@v25
|
|
- uses: cachix/cachix-action@v14
|
|
with:
|
|
name: tree-grepper
|
|
- run: nix-env -if https://github.com/BrianHicks/tree-grepper/archive/refs/heads/main.tar.gz
|
|
- name: Run trailing comma lint rule
|
|
run: |
|
|
# Using `grep .` as the exit codes are always true for correct grammar
|
|
if tree-grepper -q go '(argument_list "," @no-trailing-comma .)' | grep .; then
|
|
echo "No trailing commas for function calls"
|
|
exit 1
|
|
fi
|
|
- name: Check for empty string comparison
|
|
run: |
|
|
# Using `grep .` as the exit codes are always true for correct grammar
|
|
if tree-grepper -q go '((binary_expression (identifier) ["==" "!="] (interpreted_string_literal) @_ri) @exp (#eq? @_ri "\"\""))' | grep .; then
|
|
echo "Use len check instead of empty string comparison"
|
|
exit 1
|
|
fi
|
|
- name: Check for cases where errors are not propagated
|
|
run: |
|
|
# Using `grep .` as the exit codes are always true for correct grammar
|
|
if tree-grepper -q go '((if_statement (binary_expression) @_if (block (return_statement (expression_list (call_expression (selector_expression) @_fun ) @ret .)))) (#match? @_if "err != nil") (#match? @_fun "clues.NewWC"))' | grep .; then
|
|
echo "Make sure to propagate errors with clues"
|
|
exit 1
|
|
fi
|
|
- name: Check if clues without context are used when context is passed in
|
|
run: |
|
|
# Using `grep .` as the exit codes are always true for correct grammar
|
|
if tree-grepper -q go '((function_declaration (parameter_list . (parameter_declaration (identifier) @_octx)) body: (block (short_var_declaration left: (expression_list (identifier) @_err . ) right: (expression_list (call_expression (argument_list . (identifier) @_ctx)))) . (if_statement (binary_expression) @_exp consequence: (block (return_statement (expression_list (call_expression (selector_expression (call_expression (selector_expression) @clue))) . )))))) (#eq? @_err "err") (#eq? @_octx "ctx") (#eq? @_ctx "ctx") (#eq? @_exp "err != nil") (#match? @clue "^clues\.") (#match? @clue "WC$"))' | grep .; then
|
|
echo "Do not use clues.*WC when context is passed in"
|
|
exit 1
|
|
fi
|
|
- name: Check clues with context is used when context is not passed in
|
|
run: |
|
|
# Using `grep .` as the exit codes are always true for correct grammar
|
|
if tree-grepper -q go '((function_declaration (parameter_list . (parameter_declaration (identifier) @_octx)) body: (block (short_var_declaration left: (expression_list (identifier) @_err . ) right: (expression_list (call_expression (argument_list . (identifier) @_ctx)))) . (if_statement (binary_expression) @_exp consequence: (block (return_statement (expression_list (call_expression (selector_expression (call_expression (selector_expression) @clue))) . )))))) (#eq? @_err "err") (#eq? @_octx "ctx") (#not-eq? @_ctx "ctx") (#eq? @_exp "err != nil") (#match? @clue "^clues\.") (#not-match? @clue "WC$"))' | grep .; then
|
|
echo "Use clues.*WC when context is not passed in"
|
|
exit 1
|
|
fi
|
|
|
|
# ----------------------------------------------------------------------------------------------------
|
|
# --- GitHub Actions Linting -------------------------------------------------------------------------
|
|
# ----------------------------------------------------------------------------------------------------
|
|
|
|
Actions-Lint:
|
|
needs: [Precheck]
|
|
environment: Testing
|
|
runs-on: ubuntu-latest
|
|
if: needs.precheck.outputs.actionsfileschanged == 'true'
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- 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, 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'
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Publish Binary
|
|
uses: ./.github/actions/publish-binary
|
|
with:
|
|
version: ${{ needs.SetEnv.outputs.version }}
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
rudderstack_write_key: ${{ secrets.RUDDERSTACK_CORSO_WRITE_KEY }}
|
|
rudderstack_data_plane_url: ${{ secrets.RUDDERSTACK_CORSO_DATA_PLANE_URL }}
|
|
|
|
Publish-Image:
|
|
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/')
|
|
defaults:
|
|
run:
|
|
working-directory: build
|
|
env:
|
|
PLATFORMS: linux/amd64,linux/arm64
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
# Setup buildx
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
# retrieve credentials for ghcr.io
|
|
- name: Login to Github Packages
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Extract metadata (tags, labels) for Docker
|
|
id: meta
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: ${{ env.IMAGE_NAME }}
|
|
tags: |
|
|
type=ref,event=tag
|
|
type=sha,format=short,prefix=
|
|
type=raw,value=nightly
|
|
|
|
# deploy the image
|
|
- name: Build image and push to GitHub Container Registry
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
file: ./build/Dockerfile
|
|
platforms: ${{ env.PLATFORMS }}
|
|
push: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
build-args: |
|
|
CORSO_BUILD_LDFLAGS=-X 'github.com/alcionai/corso/src/internal/events.RudderStackWriteKey=${{ secrets.RUDDERSTACK_CORSO_WRITE_KEY }}' -X 'github.com/alcionai/corso/src/internal/events.RudderStackDataPlaneURL=${{ secrets.RUDDERSTACK_CORSO_DATA_PLANE_URL }}' -X 'github.com/alcionai/corso/src/internal/version.Version=${{ needs.SetEnv.outputs.version }}'
|
|
# use the github cache
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|
|
|
|
Validate-Linux-Artifacts:
|
|
needs: [Publish-Binary, Publish-Image, SetEnv]
|
|
environment: Testing
|
|
runs-on: ubuntu-latest
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
env:
|
|
CORSO_VERSION: ${{ needs.SetEnv.outputs.version }}
|
|
steps:
|
|
- name: Validate x86_64 binary artifacts
|
|
run: |
|
|
set -ex
|
|
curl -L https://github.com/alcionai/corso/releases/download/${{ env.CORSO_VERSION }}/corso_${{ env.CORSO_VERSION }}_Linux_x86_64.tar.gz > corso.tar.gz
|
|
tar -xf corso.tar.gz
|
|
./corso --help
|
|
./corso --version 2>&1 | grep -E "version: ${{ env.CORSO_VERSION }}$"
|
|
- name: Validate arm64 binary artifacts
|
|
uses: uraimo/run-on-arch-action@v2
|
|
with:
|
|
arch: armv7
|
|
distro: ubuntu18.04
|
|
install: |
|
|
apt-get -y update && apt-get -y install curl
|
|
run: |
|
|
set -ex
|
|
sudo apt-get update && sudo apt-get install curl
|
|
curl -L https://github.com/alcionai/corso/releases/download/${{ env.CORSO_VERSION }}/corso_${{ env.CORSO_VERSION }}_Linux_arm64.tar.gz > corso.tar.gz
|
|
tar -xf corso.tar.gz
|
|
./corso --help
|
|
./corso --version 2>&1 | grep -E "version: ${{ env.CORSO_VERSION }}$"
|
|
|
|
Validate-Docker-Artifacts:
|
|
needs: [Publish-Binary, Publish-Image, SetEnv]
|
|
environment: Testing
|
|
runs-on: ubuntu-latest
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
env:
|
|
CORSO_VERSION: ${{ needs.SetEnv.outputs.version }}
|
|
steps:
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Validate amd64 container images
|
|
run: |
|
|
docker run --platform linux/amd64 ${{ env.IMAGE_NAME }}:${{ env.CORSO_VERSION }} --help
|
|
docker run --platform linux/amd64 ${{ env.IMAGE_NAME }}:${{ env.CORSO_VERSION }} --version | grep -E "version: ${{ env.CORSO_VERSION }}$"
|
|
- name: Validate arm64 container images
|
|
run: |
|
|
docker run --platform linux/arm64 ${{ env.IMAGE_NAME }}:${{ env.CORSO_VERSION }} --help
|
|
docker run --platform linux/amd64 ${{ env.IMAGE_NAME }}:${{ env.CORSO_VERSION }} --version | grep -E "version: ${{ env.CORSO_VERSION }}$"
|
|
|
|
Validate-MacOS-Artifacts:
|
|
needs: [Publish-Binary, Publish-Image, SetEnv]
|
|
environment: Testing
|
|
runs-on: macos-latest
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
env:
|
|
CORSO_VERSION: ${{ needs.SetEnv.outputs.version }}
|
|
steps:
|
|
- name: Validate x86_64 binary artifacts
|
|
run: |
|
|
set -ex
|
|
curl -L https://github.com/alcionai/corso/releases/download/${{ env.CORSO_VERSION }}/corso_${{ env.CORSO_VERSION }}_Darwin_x86_64.tar.gz > corso.tar.gz
|
|
tar -xf corso.tar.gz
|
|
./corso --help
|
|
./corso --version 2>&1 | grep -E "version: ${{ env.CORSO_VERSION }}$"
|
|
- name: Validate arm64 binary artifacts
|
|
run: |
|
|
set -ex
|
|
curl -L https://github.com/alcionai/corso/releases/download/${{ env.CORSO_VERSION }}/corso_${{ env.CORSO_VERSION }}_Darwin_arm64.tar.gz > corso.tar.gz
|
|
tar -xf corso.tar.gz
|
|
# TODO: test/validate arm64 executable once we have arm64 CI
|
|
|
|
Validate-Windows-Artifacts:
|
|
needs: [Publish-Binary, Publish-Image, SetEnv]
|
|
environment: Testing
|
|
runs-on: windows-latest
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
env:
|
|
CORSO_VERSION: ${{ needs.SetEnv.outputs.version }}
|
|
steps:
|
|
- name: Validate x86_64 binary artifacts
|
|
run: |
|
|
curl -L https://github.com/alcionai/corso/releases/download/${{ env.CORSO_VERSION }}/corso_${{ env.CORSO_VERSION }}_Windows_x86_64.zip -o corso.zip
|
|
7z x corso.zip
|
|
./corso.exe --help
|
|
./corso.exe --version 2>&1 | grep -E "version: ${{ env.CORSO_VERSION }}$"
|
|
|
|
Publish-Website-Test:
|
|
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'
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4 # need to checkout to make the action available
|
|
|
|
- name: Publish website
|
|
uses: ./.github/actions/publish-website
|
|
with:
|
|
aws-iam-role: ${{ secrets.AWS_IAM_ROLE }}
|
|
bucket: ${{ needs.SetEnv.outputs.website-bucket }}
|
|
cfid: ${{ needs.SetEnv.outputs.website-cfid }}
|
|
|
|
Publish-Website-Prod:
|
|
needs: [SetEnv, Validate-Linux-Artifacts, Validate-MacOS-Artifacts, Validate-Docker-Artifacts, Validate-Windows-Artifacts]
|
|
environment: ${{ needs.SetEnv.outputs.environment }}
|
|
runs-on: ubuntu-latest
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4 # need to checkout to make the action available
|
|
|
|
- name: Publish website
|
|
uses: ./.github/actions/publish-website
|
|
with:
|
|
aws-iam-role: ${{ secrets.AWS_IAM_ROLE }}
|
|
bucket: ${{ needs.SetEnv.outputs.website-bucket }}
|
|
cfid: ${{ needs.SetEnv.outputs.website-cfid }}
|
|
|
|
Validate-Website-Artifacts:
|
|
needs: [Publish-Website-Prod, SetEnv]
|
|
environment: Testing
|
|
runs-on: ubuntu-latest
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
env:
|
|
CORSO_VERSION: ${{ needs.SetEnv.outputs.version }}
|
|
steps:
|
|
- name: Validate docs
|
|
run: |
|
|
curl https://corsobackup.io/docs/quickstart/ | grep https://github.com/alcionai/corso/releases/download/${{ env.CORSO_VERSION }}/corso_${{ env.CORSO_VERSION }}_Linux_x86_64.tar.gz
|