Skip to content

Fix escaping of column names in SQL exporter (#5674) #1616

Fix escaping of column names in SQL exporter (#5674)

Fix escaping of column names in SQL exporter (#5674) #1616

name: Snapshot release
on:
push:
branches:
- 'master'
- '4.0'
paths-ignore:
- 'docs/**'
release:
types: [created]
jobs:
prepare_ui_test_matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Setup Node
uses: actions/setup-node@v3.6.0
with:
node-version: '14'
- id: set-matrix
run: npm install --save glob@8.1.0 && node main/tests/cypress/build-test-matrix.js >> $GITHUB_OUTPUT
env:
browsers: chrome
ui_test:
needs: prepare_ui_test_matrix
runs-on: ubuntu-latest
strategy:
matrix: ${{fromJSON(needs.prepare_ui_test_matrix.outputs.matrix)}}
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Set up secrets
run: |
echo "CYPRESS_RECORD_KEY=$(echo YzE3ZDU4OGItZTBkOC00ZjJmLTg4NjYtNzJmNmFmYmRhNGQxCg== | base64 -d)" >> $GITHUB_ENV
echo "CYPRESS_PROJECT_ID=s5du3k" >> $GITHUB_ENV
- name: Set up Java 11
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 11
cache: 'maven'
- name: Build OpenRefine
run: ./refine build
- name: Setup Node
uses: actions/setup-node@v3.6.0
with:
node-version: '14'
- name: Restore Tests dependency cache
uses: actions/cache@v3
with:
path: |
~/cache
~/.cache
**/node_modules
!~/cache/exclude
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn
- name: Install test dependencies
run: |
cd ./main/tests/cypress
npm i -g yarn
yarn install
- name: Test with Cypress on ${{ matrix.browser }}
run: |
echo REFINE_MIN_MEMORY=1400M >> ./refine.ini
echo REFINE_MEMORY=4096M >> ./refine.ini
./refine ui_tests
env:
CYPRESS_BROWSER: ${{ matrix.browser }}
CYPRESS_RECORD_KEY: ${{ env.CYPRESS_RECORD_KEY }}
CYPRESS_PROJECT_ID: ${{ env.CYPRESS_PROJECT_ID }}
CYPRESS_CI_BUILD_ID: '${{ github.run_id }}'
CYPRESS_SPECS: ${{ matrix.specs }}
build:
services:
postgres:
image: postgres
ports:
- 5432
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: 'postgres'
POSTGRES_DB: test_db
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
mysql:
image: mysql:8
ports:
- 3306
env:
MYSQL_ROOT_PASSWORD: root
options: >-
--health-cmd "mysqladmin ping"
--health-interval 5s
--health-timeout 2s
--health-retries 3
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # This is wasteful, but needed for git describe
- name: Set up secrets
run: |
echo "COVERALLS_TOKEN=$(echo eUVUVGRHOFJhQm9GMFJBYTNibjVhcWFEblpac1lmMlE3Cg== | base64 -d)" >> $GITHUB_ENV
- name: Set up Java 11
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 11
cache: 'maven'
server-id: ossrh
server-username: OSSRH_USER
server-password: OSSRH_PASS
- name: Install genisoimage and jq
run: sudo apt-get install genisoimage jq
- name: Configure connections to databases
id: configure_db_connections
run: cat extensions/database/tests/conf/github_actions_tests.xml | sed -e "s/MYSQL_PORT/${{ job.services.mysql.ports[3306] }}/g" | sed -e "s/POSTGRES_PORT/${{ job.services.postgres.ports[5432] }}/g" > extensions/database/tests/conf/tests.xml
- name: Populate databases with test data
id: populate_databases_with_test_data
run: |
mysql -u root -h 127.0.0.1 -P ${{ job.services.mysql.ports[3306] }} -proot -e 'CREATE DATABASE test_db;'
mysql -u root -h 127.0.0.1 -P ${{ job.services.mysql.ports[3306] }} -proot < extensions/database/tests/conf/test-mysql.sql
psql -U postgres test_db -h 127.0.0.1 -p ${{ job.services.postgres.ports[5432] }} < extensions/database/tests/conf/test-pgsql.sql
env:
PGPASSWORD: postgres
- name: Install webapp dependencies
run: cd main/webapp && npm install
- name: Build and test with Maven
run: mvn jacoco:prepare-agent test
- name: Install webapp dependencies
run: cd main/webapp && npm install
- name: Generate dist files
run: mvn package -DskipTests=true
mac_test_and_deploy:
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- name: Set up Java 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
cache: 'maven'
server-id: ossrh
server-username: OSSRH_USER
server-password: OSSRH_PASS
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: GPG_PASSPHRASE
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3'
- name: Install dmgbuild
run: pip install dmgbuild
- name: Decrypt Apple certificates
run: |
gpg --pinentry-mode loopback --passphrase "${{ secrets.GPG_PASSPHRASE }}" --output .github/workflows/release/apple_cert.cer --decrypt packaging/apple_certs/apple_cert.cer.enc
gpg --pinentry-mode loopback --passphrase "${{ secrets.GPG_PASSPHRASE }}" --output .github/workflows/release/apple_cert.p12 --decrypt packaging/apple_certs/apple_cert.p12.enc
.github/workflows/release/add_apple_keys.sh
env:
P12_PASSPHRASE: ${{ secrets.APPLE_P12_PASSPHRASE }}
- name: Apply patch to insert Google API credentials
run: |
gpg --pinentry-mode loopback --passphrase "${{ secrets.GPG_PASSPHRASE }}" --output .github/workflows/release/gdata.patch --decrypt .github/workflows/release/gdata.patch.asc
git am .github/workflows/release/gdata.patch
git reset HEAD^
- name: Install webapp dependencies
run: cd main/webapp && npm install
- name: Build and test
run: mvn test
env:
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- name: Package and upload to OSSRH
run: |
mvn package deploy -DskipTests=true -DrepositoryId=ossrh -Dapple.notarization.username=$APPLE_USERNAME -Dapple.notarization.password=$APPLE_PASSWORD -Dapple.notarization.team.id=$APPLE_TEAM_ID
env:
OSSRH_USER: ${{ secrets.OSSRH_USER }}
OSSRH_PASS: ${{ secrets.OSSRH_PASS }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
APPLE_USERNAME: ${{ secrets.APPLE_USERNAME }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
- name: Get release upload URL
id: get_release_upload_url
if: github.event_name == 'release'
uses: bruceadams/get-release@v1.3.2
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Upload release asset for Windows (without Java)
id: upload-release-asset-win
if: github.event_name == 'release'
uses: shogo82148/actions-upload-release-asset@v1.6.4
with:
upload_url: ${{ steps.get_release_upload_url.outputs.upload_url }}
asset_path: ./packaging/target/openrefine-win-${{ steps.get_release_upload_url.outputs.tag_name }}.zip
asset_name: openrefine-win-${{ steps.get_release_upload_url.outputs.tag_name }}.zip
asset_content_type: application/zip
- name: Upload release asset for Windows (with Java)
id: upload-release-asset-win-with-java
if: github.event_name == 'release'
uses: shogo82148/actions-upload-release-asset@v1.6.4
with:
upload_url: ${{ steps.get_release_upload_url.outputs.upload_url }}
asset_path: ./packaging/target/openrefine-win-with-java-${{ steps.get_release_upload_url.outputs.tag_name }}.zip
asset_name: openrefine-win-with-java-${{ steps.get_release_upload_url.outputs.tag_name }}.zip
asset_content_type: application/zip
- name: Upload Release Asset Linux
id: upload-release-asset-linux
if: github.event_name == 'release'
uses: shogo82148/actions-upload-release-asset@v1.6.4
with:
upload_url: ${{ steps.get_release_upload_url.outputs.upload_url }}
asset_path: ./packaging/target/openrefine-linux-${{ steps.get_release_upload_url.outputs.tag_name }}.tar.gz
asset_name: openrefine-linux-${{ steps.get_release_upload_url.outputs.tag_name }}.tar.gz
asset_content_type: application/tar+gzip
- name: Upload Release Asset Mac
id: upload-release-asset-mac
if: github.event_name == 'release'
uses: shogo82148/actions-upload-release-asset@v1.6.4
with:
upload_url: ${{ steps.get_release_upload_url.outputs.upload_url }}
asset_path: ./packaging/target/openrefine-mac-${{ steps.get_release_upload_url.outputs.tag_name }}.dmg
asset_name: openrefine-mac-${{ steps.get_release_upload_url.outputs.tag_name }}.dmg
asset_content_type: application/x-apple-diskimage