Revamp tests #2425
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Integration Tests | |
on: | |
push: | |
paths-ignore: | |
- 'docs/**' | |
- '**/*.md' | |
branches: | |
- master | |
pull_request: | |
schedule: | |
- cron: "0 1 * * *" | |
concurrency: | |
group: ${{ github.event.pull_request.number || github.ref }}-integration | |
cancel-in-progress: true | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
REDIS_IMAGE: redis:latest | |
REDIS_STACK_IMAGE: redis/redis-stack-server:latest | |
CURRENT_REDIS_VERSION: '7.4.1' | |
jobs: | |
redis_version: | |
runs-on: ubuntu-latest | |
outputs: | |
CURRENT: ${{ env.CURRENT_REDIS_VERSION }} | |
steps: | |
- name: Compute outputs | |
run: | | |
echo "CURRENT=${{ env.CURRENT_REDIS_VERSION }}" >> $GITHUB_OUTPUT | |
tests: | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
needs: redis_version | |
strategy: | |
max-parallel: 15 | |
fail-fast: false | |
matrix: | |
redis-version: [ '${{ needs.redis_version.outputs.CURRENT }}', '7.2.6', '6.2.16'] | |
dotnet-version: ['6.0', '7.0', '8.0'] | |
env: | |
ACTIONS_ALLOW_UNSECURE_COMMANDS: true | |
name: Redis ${{ matrix.redis-version }}; .NET ${{ matrix.dotnet-version }}; | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run tests | |
uses: ./.github/actions/run-tests | |
with: | |
dotnet-version: ${{ matrix.dotnet-version }} | |
redis-version: ${{ matrix.redis-version }} | |
REDIS_CA_PEM: ${{ secrets.REDIS_CA_PEM }} | |
REDIS_USER_CRT: ${{ secrets.REDIS_USER_CRT }} | |
REDIS_USER_PRIVATE_KEY: ${{ secrets.REDIS_USER_PRIVATE_KEY }} | |
build_and_test_windows: | |
name: Windows Test ${{matrix.redis-stack-version}} | |
runs-on: windows-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
redis-stack-version: ['6.2.6-v9', '7.2.0-RC3'] | |
env: | |
redis_stack_version: ${{matrix.redis-stack-version}} | |
USER_NAME: ${{ secrets.USER_NAME }} | |
PASSWORD: ${{ secrets.PASSWORD }} | |
ENDPOINT: ${{ secrets.ENDPOINT }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: Vampire/setup-wsl@v2 | |
with: | |
distribution: Ubuntu-22.04 | |
- name: Install Redis | |
shell: wsl-bash {0} | |
run: | | |
sudo apt-get update | |
sudo apt-get install curl -y && sudo apt-get install gpg -y && apt-get install lsb-release -y && apt-get install libgomp1 -y | |
curl https://packages.redis.io/redis-stack/redis-stack-server-${{env.redis_stack_version}}.jammy.x86_64.tar.gz -o redis-stack.tar.gz | |
tar xf redis-stack.tar.gz | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --no-restore /p:ContinuousIntegrationBuild=true | |
- name: Save test certificates | |
shell: wsl-bash {0} | |
run: | | |
echo "${{secrets.REDIS_CA_PEM}}" > tests/NRedisStack.Tests/bin/Debug/net481/redis_ca.pem | |
echo "${{secrets.REDIS_USER_CRT}}" > tests/NRedisStack.Tests/bin/Debug/net481/redis_user.crt | |
echo "${{secrets.REDIS_USER_PRIVATE_KEY}}" > tests/NRedisStack.Tests/bin/Debug/net481/redis_user_private.key | |
ls -R | |
- name: Test | |
shell: cmd | |
run: | | |
START wsl ./redis-stack-server-${{env.redis_stack_version}}/bin/redis-stack-server & | |
dotnet test -f net481 --no-build --verbosity detailed -p:BuildInParallel=false tests/Test.proj --logger GitHubActions |