Skip to content

Commit

Permalink
wip: Move to next gen CI #15 [additional tests]
Browse files Browse the repository at this point in the history
  • Loading branch information
cnouguier committed Apr 22, 2024
1 parent 01d9cae commit bbf50e7
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 13 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion scripts/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
;;
*)
Expand Down
2 changes: 1 addition & 1 deletion scripts/setup_workspace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion test/client.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand All @@ -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'
Expand Down
3 changes: 2 additions & 1 deletion test/processing.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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'
Expand Down
3 changes: 2 additions & 1 deletion test/service.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand All @@ -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'
Expand Down

0 comments on commit bbf50e7

Please sign in to comment.