prameterized pages ci.yml #44
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
# This is a basic workflow to help you get started with MATLAB Actions | |
name: SDMX Build and test | |
# Controls when the action will run. | |
on: | |
# Triggers the workflow on push or pull request events but only for the main branch | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
build-java: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
# Setup job | |
- name: Set up JDK 8 for x64 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '8' | |
distribution: 'temurin' | |
architecture: x64 | |
# Build project according to SDMX instructions | |
- name: Run the Ant jar target | |
run: cd JAVA && ant clean && ant compile && ant dist | |
# Keep JAR file to use in MATLAB | |
- name: Archive MATLAB JAR for next job | |
uses: actions/upload-artifact@v3 | |
with: | |
name: SDMX | |
path: MATLAB/lib/SDMX.jar | |
if-no-files-found: error | |
retention-days: 1 | |
build-test-matlab: | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
needs: build-java | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v4 | |
- name: Download a single artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: SDMX | |
path: MATLAB/tbx/lib | |
# Sets up MATLAB on the GitHub Actions runner | |
- name: Setup MATLAB | |
uses: matlab-actions/setup-matlab@v1 | |
with: | |
release: R2023a | |
# Run buildtool to test and package MATLAB. | |
- name: Run buildtool | |
uses: matlab-actions/run-command@v1 | |
with: | |
command: openProject('MATLAB/SDMX.prj'), buildtool | |
# Upload MATLAB Toolbox, it won't be there if the test failed | |
- name: Archive MATLAB Toolbox | |
uses: actions/upload-artifact@v3 | |
with: | |
name: MatSDMX | |
path: | | |
MATLAB/releases/SDMX.mltbx | |
if-no-files-found: ignore | |
# Set up pages to show reports. This needs to run independent of the previous results. | |
# Previous here is buildtool, since upload is canceled on failure | |
- name: Setup Pages | |
if: success() || failure() | |
uses: actions/configure-pages@v3 | |
# Upload test reports | |
- name: Upload Artifact | |
uses: actions/upload-pages-artifact@v2 | |
with: | |
# upload entire directory | |
path: MATLAB/tests/reports | |
deploy-results: | |
runs-on: ubuntu-latest | |
needs: build-test-matlab | |
if: ${{ always() }} | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
# environment created automatically by GitHub | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
# Deploy reports to GitHub Pages | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v2 | |
# Publish the report address to GitHub Pages | |
- name: Create Annotation with links | |
run: | | |
echo '<a href="${{ steps.deployment.outputs.page_url }}/results/" target="_blank">Test results report</a>' >> $GITHUB_STEP_SUMMARY | |
echo '<a href="${{ steps.deployment.outputs.page_url }}/coverageReport/" target="_blank">Code coverage report</a>' >> $GITHUB_STEP_SUMMARY | |