forked from amattioc/SDMX
-
Notifications
You must be signed in to change notification settings - Fork 1
130 lines (103 loc) · 3.77 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# 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
- run: echo $JAVA_HOME
# Build project according to SDMX instructions
- name: Build JAR
run: cd JAVA && mvn package
# 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: R2024a
# 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
if: success() || failure()
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