Skip to content

chore(deps): bump openssl from 0.10.68 to 0.10.70 #15

chore(deps): bump openssl from 0.10.68 to 0.10.70

chore(deps): bump openssl from 0.10.68 to 0.10.70 #15

name: Run postman tests
on:
workflow_dispatch:
push:
branches:
- main
- "releases/*"
pull_request:
merge_group:
types: [checks_requested]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
DATABASE_URL: postgres://db_user:db_pass@localhost/encryption_db
USER: db_user
PASSWORD: db_pass
DB_NAME: encryption_db
RUN_TESTS: ${{ ((github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name)) || (github.event_name == 'merge_group') }}
jobs:
runner:
name: Run postman tests
runs-on: ubuntu-latest
services:
postgres:
image: "postgres:14.5"
env:
POSTGRES_USER: db_user
POSTGRES_PASSWORD: db_pass
POSTGRES_DB: encryption_db
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Repository checkout
uses: actions/checkout@v4
- name: Skip tests for PRs from forks
shell: bash
if: ${{ env.RUN_TESTS == 'false' }}
run: echo 'Skipping tests for PRs from forks'
- name: Install Rust
if: ${{ env.RUN_TESTS == 'true' }}
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable 2 weeks ago
components: clippy
- name: Build and Cache Rust Dependencies
if: ${{ env.RUN_TESTS == 'true' }}
uses: Swatinem/[email protected]
- name: Install Diesel CLI with Postgres Support
if: ${{ env.RUN_TESTS == 'true' }}
uses: baptiste0928/[email protected]
with:
crate: diesel_cli
features: postgres
args: "--no-default-features"
- name: Diesel migration run
if: ${{ env.RUN_TESTS == 'true' }}
shell: bash
env:
DATABASE_URL: postgres://db_user:db_pass@localhost:5432/encryption_db
run: diesel migration run
- name: Install newman from fork
if: ${{ env.RUN_TESTS == 'true' }}
run: npm install -g 'git+ssh://[email protected]:knutties/newman.git#feature/newman-dir'
- name: Build project
if: ${{ env.RUN_TESTS == 'true' }}
run: cargo build --package cripta --bin cripta
- name: Setup Local Server
if: ${{ env.RUN_TESTS == 'true' }}
run: |
target/debug/cripta &
SERVER_PID=$!
COUNT=0
while ! nc -z localhost 5000; do
if [ $COUNT -gt 12 ]; then
echo "Server did not start within a reasonable time. Exiting."
kill ${SERVER_PID}
exit 1
else
COUNT=$((COUNT+1))
sleep 10
fi
done
- name: Run Tests
if: ${{ env.RUN_TESTS == 'true' }}
env:
BASE_URL: "http://localhost:5000"
shell: bash
run: newman dir-run postman/collection-dir