Skip to content

Commit

Permalink
add ci (#2)
Browse files Browse the repository at this point in the history
* add ci

* add ci

* add ci

* add ci

* add ci

* add ci
  • Loading branch information
nicoloboschi authored May 13, 2024
1 parent 5d3d991 commit 72f9214
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Build

on:
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./
timeout-minutes: 10
id: astra
with:
token: ${{ secrets.TESTS_ASTRA_TOKEN }}
region: us-east-2
cloud: aws
- uses: nicoloboschi/cleanup-astradb@v1
if: ${{ always() && steps.astra.outputs.name != '' }}
with:
token: ${{ secrets.TESTS_ASTRA_TOKEN }}
name: ${{ steps.astra.outputs.name }}
wait: false
5 changes: 4 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,12 @@ runs:
if [ -z "${{ inputs.name }}" ]; then
prefix=""
if [ -n "${{ inputs.name-prefix }}" ]; then
echo "Generating database name with prefix: $prefix"
prefix="${{ inputs.name-prefix }}_"
else
echo "Generating database name without prefix"
fi
random_suffix=$(cat /dev/urandom | env LC_ALL=C tr -dc 'a-z0-9' | fold -w 4 | head -n 1)
random_suffix=$RANDOM
db_name="${prefix}${{ github.run_id }}_${random_suffix}"
echo "Using generated database name: $db_name"
else
Expand Down

0 comments on commit 72f9214

Please sign in to comment.