chore(deps): update dependency mocha to v11 #272
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: Build NodeJS probe | |
on: | |
push: | |
branches: [ master ] | |
paths-ignore: | |
- '**.md' | |
- '**.svg' | |
pull_request: | |
branches: [ master ] | |
paths-ignore: | |
- '**.md' | |
- '**.svg' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up NodeJS | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: Install dependencies | |
run: npm install | |
- name: Export Properties | |
id: properties | |
shell: bash | |
run: | | |
VERSION=$(grep "projectVersion" gradle.properties | cut -d'=' -f2) | |
echo "::set-output name=version::$VERSION" | |
echo "SPP_RELEASE_VERSION=${VERSION/-SNAPSHOT/}" >> $GITHUB_ENV | |
SPP_RELEASE_VERSION=${VERSION/-SNAPSHOT/} | |
echo "::set-output name=release_version::$SPP_RELEASE_VERSION" | |
- name: Start platform | |
run: ./gradlew composeUp | |
- name: Docker IPs | |
run: docker inspect --format='{{.Name}} - {{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker ps -aq) | |
- name: Set SPP_PLATFORM_HOST | |
run: SPP_PLATFORM_HOST=$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker ps -aqf "name=spp-platform")) && echo "SPP_PLATFORM_HOST=$SPP_PLATFORM_HOST" >> $GITHUB_ENV | |
- name: Set SPP_JWT_TOKEN | |
run: until $(curl --insecure --output /dev/null --silent --fail http://localhost:12800/api/new-token?authorization_code=change-me); do printf '.'; sleep 5; done && SPP_JWT_TOKEN=$(curl --insecure http://localhost:12800/api/new-token?authorization_code=change-me) && echo "SPP_JWT_TOKEN=$SPP_JWT_TOKEN" >> $GITHUB_ENV | |
- name: Wait for platform | |
run: | | |
until $(curl --header "Authorization: Bearer ${{ env.SPP_JWT_TOKEN }}" --insecure --output /dev/null --silent --fail http://localhost:12800/health); do printf '.'; sleep 5; done | |
- name: Run tests | |
run: ./gradlew test | |
- run: ./gradlew composeLogs | |
if: ${{ !cancelled() }} | |
- name: Upload docker logs artifact | |
if: ${{ !cancelled() }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: docker-logs | |
path: ./build/containers-logs | |
- name: Remove Old Release Drafts | |
if: github.ref == 'refs/heads/master' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
curl -H "Authorization: Bearer $GITHUB_TOKEN" https://api.github.com/repos/$GITHUB_REPOSITORY/releases \ | |
| tr '\r\n' ' ' \ | |
| jq '.[] | select(.draft == true) | .id' \ | |
| xargs -I '{}' \ | |
curl -X DELETE -H "Authorization: Bearer $GITHUB_TOKEN" https://api.github.com/repos/$GITHUB_REPOSITORY/releases/{} | |
- name: Create release draft | |
if: github.ref == 'refs/heads/master' | |
id: createDraft | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ env.SPP_RELEASE_VERSION }} | |
release_name: v${{ env.SPP_RELEASE_VERSION }} | |
draft: true |