Skip to content

Commit b98c8c2

Browse files
authored
Merge pull request #44 from specs-feup/fix/kadabra-js-tests
Fixes Kadabra-JS failing tests
2 parents a29df71 + e1fa063 commit b98c8c2

32 files changed

Lines changed: 791 additions & 712 deletions

.github/workflows/ant-lara-2.0-legacy.yml

Lines changed: 49 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -4,64 +4,63 @@
44
name: Java CI - Lara 2.0 Legacy
55

66
on:
7-
push:
8-
branches: [ lara-2.0-legacy ]
9-
pull_request:
10-
branches: [ lara-2.0-legacy ]
7+
push:
8+
branches: [lara-2.0-legacy]
9+
pull_request:
10+
branches: [lara-2.0-legacy]
1111

12-
# Daily at midnight
13-
schedule:
14-
- cron: '0 0 * * *'
12+
# Daily at midnight
13+
schedule:
14+
- cron: "0 0 1 * *"
1515

1616
permissions:
17-
checks: write
17+
checks: write
1818

1919
jobs:
20-
build:
20+
build:
21+
runs-on: ubuntu-latest
2122

22-
runs-on: ubuntu-latest
23+
#defaults:
24+
# run:
25+
# working-directory: ./..
2326

24-
#defaults:
25-
# run:
26-
# working-directory: ./..
27+
steps:
28+
- uses: actions/checkout@v6
29+
# Because of scheduled runs, by default run on default branch
30+
with:
31+
ref: lara-2.0-legacy
2732

28-
steps:
29-
- uses: actions/checkout@v4
30-
# Because of scheduled runs, by default run on default branch
31-
with:
32-
ref: lara-2.0-legacy
33+
- name: Cache ivy dependencies
34+
id: cache-nivy
35+
uses: actions/cache@v3
36+
env:
37+
cache-name: cache-ivy-dependencies
38+
with:
39+
# ivy dependencies cache files are stored in `~/.ivy2` on Linux/macOS
40+
path: ~/.ivy2
41+
key: ${{ runner.os }}-build-${{ env.cache-name }}
3342

34-
- name: Cache ivy dependencies
35-
id: cache-nivy
36-
uses: actions/cache@v3
37-
env:
38-
cache-name: cache-ivy-dependencies
39-
with:
40-
# ivy dependencies cache files are stored in `~/.ivy2` on Linux/macOS
41-
path: ~/.ivy2
42-
key: ${{ runner.os }}-build-${{ env.cache-name }}
43+
- name: Set up JDK 17
44+
uses: actions/setup-java@v3
45+
with:
46+
java-version: "17"
47+
distribution: "temurin"
4348

44-
- name: Set up JDK 17
45-
uses: actions/setup-java@v3
46-
with:
47-
java-version: '17'
48-
distribution: 'temurin'
49-
50-
- name: Generate build.xml
51-
run: |
52-
wget -N http://specs.fe.up.pt/tools/eclipse-build.jar
53-
java -jar eclipse-build.jar https://github.com/specs-feup/specs-java-libs https://github.com/specs-feup/lara-framework?commit=lara-2.0-legacy ./
54-
wget -N -O /usr/share/ant/lib/ivy-2.5.0.jar specs.fe.up.pt/libs/ivy-2.5.0.jar
55-
- name: Build with Ant
56-
run: |
57-
ant -noinput -buildfile build.xml
49+
- name: Generate build.xml
50+
run: |
51+
wget -N http://specs.fe.up.pt/tools/eclipse-build.jar
52+
java -jar eclipse-build.jar https://github.com/specs-feup/specs-java-libs https://github.com/specs-feup/lara-framework?commit=lara-2.0-legacy ./
53+
wget -N -O /usr/share/ant/lib/ivy-2.5.0.jar specs.fe.up.pt/libs/ivy-2.5.0.jar
54+
- name: Build with Ant
55+
run: |
56+
ant -noinput -buildfile build.xml
5857
59-
- name: Publish Test Report
60-
uses: mikepenz/action-junit-report@v3.0.1
61-
if: always() # always run even if the previous step fails
62-
with:
63-
report_paths: '**/reports-eclipse-build/TEST-*.xml'
64-
#report_paths: 'junit-reports/*.xml'
65-
#report_paths: '**/reports-eclipse-build/*.xml'
66-
summary: true
67-
#exclude_sources: ''
58+
- name: Publish Test Report
59+
uses: mikepenz/action-junit-report@v3.0.1
60+
if: always() # always run even if the previous step fails
61+
with:
62+
report_paths: "**/reports-eclipse-build/TEST-*.xml"
63+
#report_paths: 'junit-reports/*.xml'
64+
#report_paths: '**/reports-eclipse-build/*.xml'
65+
summary: true
66+
#exclude_sources: ''
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
name: "Copilot Setup Steps"
2+
3+
# Automatically run the setup steps when they are changed
4+
# Allows for streamlined validation,
5+
# and allow manual testing through the repository's "Actions" tab
6+
7+
on:
8+
workflow_dispatch:
9+
push:
10+
paths:
11+
- .github/workflows/copilot-setup-steps.yml
12+
pull_request:
13+
paths:
14+
- .github/workflows/copilot-setup-steps.yml
15+
16+
env:
17+
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
18+
19+
jobs:
20+
# The job MUST be called `copilot-setup-steps`
21+
# otherwise it will not be picked up by Copilot.
22+
copilot-setup-steps:
23+
runs-on: ubuntu-latest
24+
25+
# Permissions set just for the setup steps
26+
# Copilot has permissions to its branch
27+
28+
permissions:
29+
# To allow us to clone the repo for setup
30+
contents: read
31+
32+
# The setup steps - install our dependencies
33+
steps:
34+
- name: Setup Java
35+
uses: actions/setup-java@v4
36+
with:
37+
distribution: 'temurin'
38+
java-version: '21'
39+
40+
- name: Setup Gradle
41+
uses: gradle/actions/setup-gradle@v4
42+
with:
43+
gradle-version: current
44+
45+
- name: Checkout Kadabra
46+
uses: actions/checkout@v6
47+
with:
48+
path: kadabra
49+
50+
- name: Determine repository refs
51+
id: repo-refs
52+
shell: bash
53+
env:
54+
BRANCH_NAME: ${{ env.BRANCH_NAME }}
55+
BASE_BRANCH: ${{ github.base_ref }}
56+
run: |
57+
set -euo pipefail
58+
59+
# For each dependency repository, determine which branch to checkout.
60+
# Priority order:
61+
# 1. A branch with the same name as the current branch
62+
# 2. If this is a PR, the target branch (base_ref)
63+
# 3. The default branch of the repository
64+
65+
determine_ref() {
66+
local prefix=$1
67+
local repo=$2
68+
local url="https://github.com/${repo}.git"
69+
70+
# Get the default branch
71+
local default_branch
72+
default_branch=$(git ls-remote --symref "$url" HEAD | awk '/^ref:/ {print $2}' | sed 's@refs/heads/@@')
73+
echo "${prefix}_default=${default_branch}" >> "$GITHUB_OUTPUT"
74+
echo "Default branch for ${repo} is '${default_branch}'"
75+
76+
local ref_to_use=""
77+
78+
# Priority 1: Same branch name
79+
if [ -n "$(git ls-remote --heads "$url" "refs/heads/${BRANCH_NAME}")" ]; then
80+
ref_to_use="${BRANCH_NAME}"
81+
echo "Using matching branch '${BRANCH_NAME}' in ${repo}"
82+
# Priority 2: PR target branch (if this is a PR)
83+
elif [ -n "${BASE_BRANCH}" ] && [ -n "$(git ls-remote --heads "$url" "refs/heads/${BASE_BRANCH}")" ]; then
84+
ref_to_use="${BASE_BRANCH}"
85+
echo "Using PR target branch '${BASE_BRANCH}' in ${repo}"
86+
# Priority 3: Default branch
87+
else
88+
ref_to_use="${default_branch}"
89+
echo "Using default branch '${default_branch}' for ${repo}"
90+
fi
91+
92+
echo "${prefix}_ref=${ref_to_use}" >> "$GITHUB_OUTPUT"
93+
}
94+
95+
determine_ref "lara" "specs-feup/lara-framework"
96+
determine_ref "specs" "specs-feup/specs-java-libs"
97+
98+
- name: Echo checks
99+
run: |
100+
echo "Weaver branch: ${{ env.BRANCH_NAME }}"
101+
echo "PR target branch (if any): ${{ github.base_ref }}"
102+
echo "Lara framework ref: ${{ steps.repo-refs.outputs.lara_ref }}"
103+
echo "Lara framework default: ${{ steps.repo-refs.outputs.lara_default }}"
104+
echo "Specs-java-libs ref: ${{ steps.repo-refs.outputs.specs_ref }}"
105+
echo "Specs-java-libs default: ${{ steps.repo-refs.outputs.specs_default }}"
106+
107+
- name: Checkout lara-framework
108+
uses: actions/checkout@v6
109+
with:
110+
repository: specs-feup/lara-framework
111+
path: lara-framework
112+
ref: ${{ steps.repo-refs.outputs.lara_ref }}
113+
114+
- name: Checkout specs-java-libs
115+
uses: actions/checkout@v6
116+
with:
117+
repository: specs-feup/specs-java-libs
118+
path: specs-java-libs
119+
ref: ${{ steps.repo-refs.outputs.specs_ref }}

0 commit comments

Comments
 (0)