|
| 1 | +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time |
| 2 | +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven |
| 3 | + |
| 4 | +name: CI |
| 5 | + |
| 6 | +on: |
| 7 | + push: |
| 8 | + branches: [ master ] |
| 9 | + pull_request: |
| 10 | + branches: [ master ] |
| 11 | + release: |
| 12 | + types: [created] |
| 13 | + |
| 14 | +jobs: |
| 15 | + build: |
| 16 | + |
| 17 | + runs-on: ubuntu-latest |
| 18 | + |
| 19 | + steps: |
| 20 | + - uses: actions/checkout@v2 |
| 21 | + - name: Set up JDK 11 |
| 22 | + uses: actions/setup-java@v2 |
| 23 | + with: |
| 24 | + java-version: '11' |
| 25 | + distribution: 'temurin' |
| 26 | + cache: maven |
| 27 | + |
| 28 | + - name: Setup Node |
| 29 | + uses: actions/setup-node@v4 |
| 30 | + with: |
| 31 | + node-version: '20' |
| 32 | + |
| 33 | + - name: Restore dependency cache |
| 34 | + uses: actions/cache@v4 |
| 35 | + with: |
| 36 | + path: | |
| 37 | + cypress/openrefine-*.tar.gz |
| 38 | + **/node_modules |
| 39 | + key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} |
| 40 | + |
| 41 | + - name: Build with Maven |
| 42 | + run: mvn -B package |
| 43 | + |
| 44 | + - name: Install Cypress |
| 45 | + run: | |
| 46 | + cd ./cypress |
| 47 | + npm i -g yarn |
| 48 | + yarn install |
| 49 | +
|
| 50 | + - name: Run Cypress tests |
| 51 | + run: ./cypress/run_headless.sh |
| 52 | + |
| 53 | + - name: Get release upload URL |
| 54 | + id: get_release_upload_url |
| 55 | + if: github.event_name == 'release' |
| 56 | + uses: bruceadams/[email protected] |
| 57 | + env: |
| 58 | + GITHUB_TOKEN: ${{ github.token }} |
| 59 | + |
| 60 | + - name: Upload release asset |
| 61 | + id: upload-release-asset |
| 62 | + if: github.event_name == 'release' |
| 63 | + uses: shogo82148/[email protected] |
| 64 | + with: |
| 65 | + upload_url: ${{ steps.get_release_upload_url.outputs.upload_url }} |
| 66 | + asset_path: ./target/openrefine-files-extension-${{ env.VERSION_STRING }}.zip |
| 67 | + asset_name: openrefine-files-extension-${{ env.VERSION_STRING }}.zip |
| 68 | + asset_content_type: application/zip |
| 69 | + |
0 commit comments