-
-
Notifications
You must be signed in to change notification settings - Fork 46
130 lines (126 loc) · 3.76 KB
/
daily.yaml
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
name: Compile all
on:
workflow_dispatch:
pull_request:
repository_dispatch:
types: rebuild
schedule:
- cron: '0 0 * * *' # runs every night
jobs:
list_cores:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
outputs:
cores: ${{ steps.generate-matrix.outputs.cores }}
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
token: ${{ secrets.PAT }}
- id: generate-matrix
run: |
cd cores
# Get list of cores ready for compilation
CORES='['
for i in *; do
if [[ -e $i/cfg/macros.def && ! -e $i/cfg/skip ]]; then
if [ "$CORES" != '[' ]; then CORES="$CORES, "; fi
CORES="$CORES \"$i\""
fi
done
CORES="$CORES ]"
echo $CORES
echo "cores=${CORES}" >> $GITHUB_OUTPUT
compile_cores13:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
container:
image: jotego/jtcore13
needs:
- list_cores
strategy:
fail-fast: false
matrix:
core: ${{ fromJSON(needs.list_cores.outputs.cores) }}
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
token: ${{ secrets.PAT }}
- id: compile
run: |
# Compilation on Quartus 13
export PATH=$PATH:/usr/local/go/bin:/opt/altera/13.1/quartus/bin
git config --global --add safe.directory /__w/jtcores/jtcores
git config --global --add safe.directory /__w/jtcores/jtcores/modules/jtframe/target/pocket
./setprj.sh jtseed 10 ${{ matrix.core }} --target mist --nodbg
- id: upload
uses: actions/upload-artifact@v4
with:
name: release-q13-${{ matrix.core }}
path: release
retention-days: 1
compile_cores20:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
needs:
- list_cores
strategy:
fail-fast: false
matrix:
core: ${{ fromJSON(needs.list_cores.outputs.cores) }}
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
token: ${{ secrets.PAT }}
- id: compile
run: |
# Compilation on Quartus 20.1
docker run -e BETAKEY=${{ secrets.BETAKEY }} --network host -v `pwd`:/jtcores jotego/jtcore20 /jtcores/modules/jtframe/devops/xjtcore.sh ${{matrix.core}} mister pocket sidi sidi128
- id: upload
uses: actions/upload-artifact@v4
with:
name: release-q20-${{ matrix.core }}
path: release
retention-days: 1
upload:
runs-on: ubuntu-latest
needs: [ compile_cores20 ]
if: ${{ always() }} # upload the results even if some core did not compile correctly
steps:
- uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: release
pattern: release-q*
merge-multiple: true
- name: Set zip file name
run: |
echo ARTIFACT_NAME=`git rev-parse --short HEAD`.zip >> "$GITHUB_ENV"
echo COMMIT_DATE=$(git show -s --format=%ci 2> /dev/null) >> "$GITHUB_ENV"
- name: Make zip file
run: |
ls -l release/*
echo ARTIFACT_NAME=$ARTIFACT_NAME
zip -r $ARTIFACT_NAME release
touch -m -d "$COMMIT_DATE" "$ARTIFACT_NAME"
ls -l $ARTIFACT_NAME
- name: Upload bundle
uses: bayssmekanique/action-simple-file-upload@v2
with:
user: ${{ secrets.FTPUSER }}
password: ${{ secrets.FTPPASS }}
host: jotego.es
src: ${{ env.ARTIFACT_NAME }}
dest: ${{ env.ARTIFACT_NAME }}
- uses: geekyeggo/delete-artifact@v4
with:
name: $ARTIFACT_NAME