diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index bfe9772..024c775 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -1,11 +1,9 @@ -name: CI -on: [ push, workflow_dispatch ] +name: ci +on: [ push, workflow_disTOKENch ] jobs: run_tests: name: Run tests - concurrency: - group: ci runs-on: ubuntu-22.04 steps: - name: Checkout repo @@ -16,7 +14,7 @@ jobs: run: bash ./scripts/init_runner.sh ${{ github.job }} - name: Setup workspace env: - GITHUB_DEVELOPMENT_PAT: ${{ secrets.GH_DEVELOPMENT_PAT }} + GITHUB_DEVELOPMENT_TOKEN: ${{ secrets.GH_DEVELOPMENT_TOKEN }} run: bash ./scripts/setup_workspace.sh - name: Run tests env: @@ -30,8 +28,6 @@ jobs: matrix: node: [ 18, 20 ] name: Additional tests (node ${{ matrix.node }}) - concurrency: - group: ci if: ${{ contains(github.event.head_commit.message, 'additional tests') }} runs-on: ubuntu-22.04 steps: @@ -43,7 +39,7 @@ jobs: run: bash ./scripts/init_runner.sh ${{ github.job }} - name: Setup workspace env: - GITHUB_DEVELOPMENT_PAT: ${{ secrets.GH_DEVELOPMENT_PAT }} + GITHUB_DEVELOPMENT_TOKEN: ${{ secrets.GH_DEVELOPMENT_TOKEN }} run: bash ./scripts/setup_workspace.sh - name: Run tests env: diff --git a/scripts/run_tests.sh b/scripts/run_tests.sh index 02dae70..ba522be 100755 --- a/scripts/run_tests.sh +++ b/scripts/run_tests.sh @@ -25,8 +25,8 @@ while getopts "n:cr:" option; do CODE_COVERAGE=true ;; r) # report outcome to slack + CI_STEP_NAME=$OPTARG load_env_files "$WORKSPACE_DIR/development/common/SLACK_WEBHOOK_LIBS.enc.env" - CI_STEP_NAME=$OPTARG trap 'slack_ci_report "$ROOT_DIR" "$CI_STEP_NAME" "$?" "$SLACK_WEBHOOK_LIBS"' EXIT ;; *) diff --git a/scripts/setup_workspace.sh b/scripts/setup_workspace.sh index 49052ea..d31e716 100755 --- a/scripts/setup_workspace.sh +++ b/scripts/setup_workspace.sh @@ -15,7 +15,7 @@ begin_group "Setting up workspace ..." if [ "$CI" = true ]; then WORKSPACE_DIR="$(dirname "$ROOT_DIR")" - DEVELOPMENT_REPO_URL="https://$GITHUB_DEVELOPMENT_PAT@github.com/kalisio/development.git" + DEVELOPMENT_REPO_URL="https://$GITHUB_DEVELOPMENT_TOKEN@github.com/kalisio/development.git" else while getopts "b:t" option; do case $option in diff --git a/test/client.test.js b/test/client.test.js index 2f20731..cd7990c 100644 --- a/test/client.test.js +++ b/test/client.test.js @@ -9,6 +9,7 @@ import feathersSocketio from '@feathersjs/socketio' import io from 'socket.io-client' import { Service, getClientService } from '../lib/index.js' import fs from 'fs' +import crypto from 'crypto' import { Blob } from 'buffer' import fetch from 'node-fetch' @@ -32,7 +33,7 @@ const options = { signatureVersion: 'v4' }, bucket: process.env.S3_BUCKET, - prefix: 'feathers-s3-test-client' + prefix: crypto.randomUUID() } const textFileId = 'text.txt' diff --git a/test/processing.test.js b/test/processing.test.js index d576bcc..8b37968 100644 --- a/test/processing.test.js +++ b/test/processing.test.js @@ -5,6 +5,7 @@ import chailint from 'chai-lint' import sharp from 'sharp' import express from '@feathersjs/express' import fs from 'fs' +import crypto from 'crypto' import { Service } from '../lib/index.js' feathers.setDebug(makeDebug) @@ -22,7 +23,7 @@ const options = { signatureVersion: 'v4' }, bucket: process.env.S3_BUCKET, - prefix: 'feathers-s3-test-service' + prefix: crypto.randomUUID() } const fileId = 'image.png' diff --git a/test/service.test.js b/test/service.test.js index f42c640..036df0f 100644 --- a/test/service.test.js +++ b/test/service.test.js @@ -5,6 +5,7 @@ import chailint from 'chai-lint' import superagent from 'superagent' import express from '@feathersjs/express' import fs from 'fs' +import crypto from 'crypto' import { Blob } from 'buffer' import { Service, getObject } from '../lib/index.js' @@ -23,7 +24,7 @@ const options = { signatureVersion: 'v4' }, bucket: process.env.S3_BUCKET, - prefix: 'feathers-s3-test-service' + prefix: crypto.randomUUID() } const fileId = 'features.geojson'