corso/.github/workflows/sanity-test.yaml
dependabot[bot] 69c824fc74
⬆️ Bump aws-actions/configure-aws-credentials from 1 to 2 (#2769)
Bumps [aws-actions/configure-aws-credentials](https://github.com/aws-actions/configure-aws-credentials) from 1 to 2.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/aws-actions/configure-aws-credentials/releases">aws-actions/configure-aws-credentials's releases</a>.</em></p>
<blockquote>
<h2>v2</h2>
<p>This tag tracks the latest v2.x.x release.</p>
<h2>v2.0.0</h2>
<p>See the <a href="https://github.com/aws-actions/configure-aws-credentials/blob/v2.0.0/CHANGELOG.md">changelog</a> for details about the changes included in this release.</p>
<h2>v1.7.0</h2>
<p>See the <a href="https://github.com/aws-actions/configure-aws-credentials/blob/HEAD/CHANGELOG.md">changelog</a> for details about the changes included in this release.</p>
<h2>v1.6.1</h2>
<p>See the <a href="https://github.com/aws-actions/configure-aws-credentials/blob/HEAD/CHANGELOG.md">changelog</a> for details about the changes included in this release.</p>
<h2>v1.6.0</h2>
<p>See the <a href="https://github.com/aws-actions/configure-aws-credentials/blob/HEAD/CHANGELOG.md">changelog</a> for details about the changes included in this release.</p>
<h2>v1.5.11</h2>
<p>See the <a href="https://github.com/aws-actions/configure-aws-credentials/blob/HEAD/CHANGELOG.md">changelog</a> for details about the changes included in this release.</p>
<h2>v1.5.10</h2>
<p>See the <a href="https://github.com/aws-actions/configure-aws-credentials/blob/HEAD/CHANGELOG.md">changelog</a> for details about the changes included in this release.</p>
<h2>v1.5.9</h2>
<p>See the <a href="https://github.com/aws-actions/configure-aws-credentials/blob/HEAD/CHANGELOG.md">changelog</a> for details about the changes included in this release.</p>
<h2>v1.5.8</h2>
<p>See the <a href="https://github.com/aws-actions/configure-aws-credentials/blob/HEAD/CHANGELOG.md">changelog</a> for details about the changes included in this release.</p>
<h2>v1.5.7</h2>
<p>See the <a href="https://github.com/aws-actions/configure-aws-credentials/blob/HEAD/CHANGELOG.md">changelog</a> for details about the changes included in this release.</p>
<h2>v1.5.6</h2>
<p>See the <a href="https://github.com/aws-actions/configure-aws-credentials/blob/HEAD/CHANGELOG.md">changelog</a> for details about the changes included in this release.</p>
<h2>v1.5.5</h2>
<p>See the <a href="https://github.com/aws-actions/configure-aws-credentials/blob/HEAD/CHANGELOG.md">changelog</a> for details about the changes included in this release.</p>
<h2>v1.5.4</h2>
<p>See the <a href="https://github.com/aws-actions/configure-aws-credentials/blob/HEAD/CHANGELOG.md">changelog</a> for details about the changes included in this release.</p>
<h2>v1.5.3</h2>
<p>See the <a href="https://github.com/aws-actions/configure-aws-credentials/blob/HEAD/CHANGELOG.md">changelog</a> for details about the changes included in this release.</p>
<h2>v1.5.2</h2>
<p>See the <a href="https://github.com/aws-actions/configure-aws-credentials/blob/HEAD/CHANGELOG.md">changelog</a> for details about the changes included in this release.</p>
<h2>v1.5.1</h2>
<p>See the <a href="https://github.com/aws-actions/configure-aws-credentials/blob/HEAD/CHANGELOG.md">changelog</a> for details about the changes included in this release.</p>
<h2>v1.5.0</h2>
<p>See the <a href="https://github.com/aws-actions/configure-aws-credentials/blob/HEAD/CHANGELOG.md">changelog</a> for details about the changes included in this release.</p>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/aws-actions/configure-aws-credentials/blob/main/CHANGELOG.md">aws-actions/configure-aws-credentials's changelog</a>.</em></p>
<blockquote>
<h2><a href="https://github.com/aws-actions/configure-aws-credentials/compare/v1.7.0...v2.0.0">2.0.0</a> (2023-03-06)</h2>
<h3>Features</h3>
<ul>
<li>Version bump to use Node 16 by default.</li>
</ul>
<h2><a href="https://github.com/aws-actions/configure-aws-credentials/compare/v1.6.1...v1.7.0">1.7.0</a> (2022-08-03)</h2>
<h3>Features</h3>
<ul>
<li>Allow audience to be explicitly specified (<a href="2f8dfd0ed4">2f8dfd0</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="e1e17a757e"><code>e1e17a7</code></a> Version 2 release (<a href="https://redirect.github.com/aws-actions/configure-aws-credentials/issues/685">#685</a>)</li>
<li><a href="bab55d3830"><code>bab55d3</code></a> chore: Bump axios from 1.3.3 to 1.3.4 (<a href="https://redirect.github.com/aws-actions/configure-aws-credentials/issues/679">#679</a>)</li>
<li><a href="07b737a14f"><code>07b737a</code></a> chore: Update dist</li>
<li><a href="26e4efa71f"><code>26e4efa</code></a> chore: Bump aws-sdk from 2.1320.0 to 2.1324.0 (<a href="https://redirect.github.com/aws-actions/configure-aws-credentials/issues/677">#677</a>)</li>
<li><a href="7e0ecf0346"><code>7e0ecf0</code></a> chore: Bump eslint from 8.34.0 to 8.35.0 (<a href="https://redirect.github.com/aws-actions/configure-aws-credentials/issues/675">#675</a>)</li>
<li><a href="567d4149d6"><code>567d414</code></a> Merge pull request <a href="https://redirect.github.com/aws-actions/configure-aws-credentials/issues/563">#563</a> from russau/docs/readme-role-update</li>
<li><a href="32eb1b4a66"><code>32eb1b4</code></a> feat: document mask-aws-account-id input (<a href="https://redirect.github.com/aws-actions/configure-aws-credentials/issues/606">#606</a>)</li>
<li><a href="6ca2577643"><code>6ca2577</code></a> chore: Update dist</li>
<li><a href="f1de076135"><code>f1de076</code></a> chore: Bump aws-sdk from 2.1273.0 to 2.1320.0 (<a href="https://redirect.github.com/aws-actions/configure-aws-credentials/issues/666">#666</a>)</li>
<li><a href="077fd1fc8f"><code>077fd1f</code></a> chore: Bump jest from 29.4.2 to 29.4.3 (<a href="https://redirect.github.com/aws-actions/configure-aws-credentials/issues/663">#663</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/aws-actions/configure-aws-credentials/compare/v1...v2">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=aws-actions/configure-aws-credentials&package-manager=github_actions&previous-version=1&new-version=2)](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 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>
2023-03-13 14:23:32 +00:00

263 lines
8.8 KiB
YAML

name: Sanity Testing
on:
push:
branches:
- main
workflow_dispatch:
permissions:
# required to retrieve AWS credentials
id-token: write
contents: write
# cancel currently running jobs if a new version of the branch is pushed
concurrency:
group: sanity_testing-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
Sanity-Tests:
environment: Testing
runs-on: ubuntu-latest
env:
AZURE_CLIENT_ID: ${{ secrets.CLIENT_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
AZURE_TENANT_ID: ${{ secrets.TENANT_ID }}
CORSO_M365_TEST_USER_ID: ${{ secrets.CORSO_M365_TEST_USER_ID }}
CORSO_PASSPHRASE: ${{ secrets.INTEGRATION_TEST_CORSO_PASSPHRASE }}
TEST_RESULT: "test_results"
CORSO_BUCKET: ${{ secrets.CI_TESTS_S3_BUCKET }}
defaults:
run:
working-directory: src
steps:
- uses: actions/checkout@v3
- name: Setup Golang with cache
uses: magnetikonline/action-golang-cache@v4
with:
go-version-file: src/go.mod
- run: make build
- run: go build -o sanityCheck ./cmd/sanity_test
- run: mkdir test_results
# AWS creds
- name: Configure AWS credentials from Test account
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ secrets.AWS_IAM_ROLE }}
role-session-name: integration-testing
aws-region: us-east-1
# run the tests
- name: Version Test
run: |
set -euo pipefail
if [ $( ./corso --version | grep 'Corso version:' | wc -l) -ne 1 ]
then
echo "valid version not found"
exit 1
fi
- name: Repo init test
id: repo-init
env:
TEST_RESULT: "test_results"
run: |
set -euo pipefail
prefix=`date +"%Y-%m-%d-%T"`
./corso repo init s3 \
--hide-progress \
--prefix $prefix \
--bucket ${CORSO_BUCKET} 2>&1 | tee $TEST_RESULT/initrepo.txt
if ! grep -q 'Initialized a S3 repository within bucket' $TEST_RESULT/initrepo.txt
then
echo "repo could not be initiated"
exit 1
fi
echo result="$prefix" >> $GITHUB_OUTPUT
# run the tests
- name: Repo connect test
run: |
set -euo pipefail
./corso repo connect s3 \
--hide-progress \
--prefix ${{ steps.repo-init.outputs.result }} \
--bucket ${CORSO_BUCKET} 2>&1 | tee $TEST_RESULT/connect.txt
if ! grep -q 'Connected to S3 bucket' $TEST_RESULT/connect.txt
then
echo "repo could not be connected"
exit 1
fi
# run the tests
- name: Backup exchange test
id: exchange-test
run: |
./corso backup create exchange \
--user "${CORSO_M365_TEST_USER_ID}" \
--hide-progress 2>&1 | tee $TEST_RESULT/backup_exchange.txt
if ! grep -q 'Completed' $TEST_RESULT/backup_exchange.txt
then
echo "backup was not successfull"
exit 1
fi
echo result=$(grep -i -e 'Completed' $TEST_RESULT/backup_exchange.txt | awk '{print $2}') >> $GITHUB_OUTPUT
# list the backup exhange
- name: Backup exchange list test
run: |
set -euo pipefail
./corso backup list exchange \
--hide-progress 2>&1 | tee $TEST_RESULT/backup_exchange_list.txt
if ! grep -q ${{ steps.exchange-test.outputs.result }} $TEST_RESULT/backup_exchange_list.txt
then
echo "listing of backup was not successfull"
exit 1
fi
# test exchange restore
- name: Backup exchange restore
id: exchange-restore-test
run: |
set -euo pipefail
./corso restore exchange \
--hide-progress \
--backup "${{ steps.exchange-test.outputs.result }}" 2>&1 | tee $TEST_RESULT/exchange-restore-test.txt
echo result=$(grep -i -e 'Restoring to folder ' $TEST_RESULT/exchange-restore-test.txt | sed "s/Restoring to folder//" ) >> $GITHUB_OUTPUT
- name: Restoration check
env:
RESTORE_FOLDER: ${{ steps.exchange-restore-test.outputs.result }}
RESTORE_SERVICE: "exchange"
run: |
set -euo pipefail
./sanityCheck
# test incremental backup exhange
- name: Backup exchange incremental
id: exchange-incremental-test
run: |
set -euo pipefail
./corso backup create exchange \
--user "${CORSO_M365_TEST_USER_ID}" \
--hide-progress 2>&1 | tee $TEST_RESULT/backup_exchange_incremental.txt
if ! grep -q 'Completed' $TEST_RESULT/backup_exchange_incremental.txt
then
echo "backup was not successful"
exit 1
fi
echo result=$(grep -i -e 'Completed' $TEST_RESULT/backup_exchange_incremental.txt | awk '{print $2}') >> $GITHUB_OUTPUT
# test exchange restore
- name: Backup incremantal exchange restore
id: exchange-incremantal-restore-test
run: |
set -euo pipefail
./corso restore exchange \
--hide-progress \
--backup "${{ steps.exchange-incremental-test.outputs.result }}" 2>&1 | tee $TEST_RESULT/exchange-incremantal-restore-test.txt
echo result=$(grep -i -e 'Restoring to folder ' $TEST_RESULT/exchange-incremantal-restore-test.txt | sed "s/Restoring to folder//" ) >> $GITHUB_OUTPUT
- name: Restoration check
env:
RESTORE_FOLDER: ${{ steps.exchange-incremantal-restore-test.outputs.result }}
RESTORE_SERVICE: "exchange"
run: |
set -euo pipefail
./sanityCheck
# Onedrive test
# run the tests
- name: Backup onedrive test
id: onedrive-test
run: |
set -euo pipefail
./corso backup create onedrive \
--user "${CORSO_M365_TEST_USER_ID}" \
--hide-progress 2>&1 | tee $TEST_RESULT/backup_onedrive.txt
if ! grep -q 'Completed' $TEST_RESULT/backup_onedrive.txt
then
echo "backup was not successfull"
exit 1
fi
echo result=$(grep 'Completed' $TEST_RESULT/backup_onedrive.txt | awk '{print $2}') >> $GITHUB_OUTPUT
# list the bakcup onedrive
- name: Backup onedrive list test
run: |
set -euo pipefail
./corso backup list onedrive \
--hide-progress 2>&1 | tee $TEST_RESULT/backup_onedrive_list.txt
if ! grep -q ${{ steps.onedrive-test.outputs.result }} $TEST_RESULT/backup_onedrive_list.txt
then
echo "listing of backup was not successfull"
exit 1
fi
# test onedrive restore
- name: Backup onedrive restore
id: onedrive-restore-test
run: |
set -euo pipefail
./corso restore onedrive --backup "${{ steps.onedrive-test.outputs.result }}" --hide-progress 2>&1 | tee $TEST_RESULT/onedrive-restore-test.txt
echo result=$(grep -i -e 'Restoring to folder ' $TEST_RESULT/onedrive-restore-test.txt | sed "s/Restoring to folder//") >> $GITHUB_OUTPUT
- name: Restoration oneDrive check
env:
RESTORE_FOLDER: ${{ steps.onedrive-restore-test.outputs.result }}
run: |
set -euo pipefail
./sanityCheck
# test onedrive incremental
- name: Backup onedrive test
id: onedrive-incremental-test
run: |
set -euo pipefail
./corso backup create onedrive \
--user "${CORSO_M365_TEST_USER_ID}"\
--hide-progress 2>&1 | tee $TEST_RESULT/backup_onedrive_incremental.txt
if ! grep -q 'Completed' $TEST_RESULT/backup_onedrive_incremental.txt
then
echo "backup was not successfull"
exit 1
fi
echo result=$(grep -i -e 'Completed' $TEST_RESULT/backup_onedrive_incremental.txt | awk '{print $2}') >> $GITHUB_OUTPUT
# test onedrive restore
- name: Backup onedrive restore
id: onedrive-incremental-restore-test
run: |
set -euo pipefail
./corso restore onedrive --backup "${{ steps.onedrive-incremental-test.outputs.result }}" --hide-progress 2>&1 | tee $TEST_RESULT/onedrive-incremental-restore-test.txt
echo result=$(grep -i -e 'Restoring to folder ' $TEST_RESULT/onedrive-incremental-restore-test.txt | sed "s/Restoring to folder//") >> $GITHUB_OUTPUT
- name: Restoration oneDrive check
env:
RESTORE_FOLDER: ${{ steps.onedrive-incremental-restore-test.outputs.result }}
run: |
set -euo pipefail
./sanityCheck