-
Notifications
You must be signed in to change notification settings - Fork 4
100 lines (81 loc) · 2.8 KB
/
Copy pathbuild_deploy.yml
File metadata and controls
100 lines (81 loc) · 2.8 KB
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
name: Build SysY-compiler and upload to xiji gitlab server
on:
push:
branches: [ master, actions ]
pull_request:
branches: [ master ]
env:
BUILD_TYPE: Release
jobs:
build:
strategy:
matrix:
os:
- ubuntu-20.04
- ubuntu-22.04
hf_option:
- "ON"
- "OFF"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Cache LLVM and Clang
id: cache-llvm
uses: actions/cache@v2
with:
path: ./llvm
key: llvm-14.0
- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v1
with:
version: "14.0"
cached: ${{ steps.cache-llvm.outputs.cache-hit }}
- name: Install Bison
run: sudo apt install -y bison
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DLLVM_DIR=${{env.LLVM_PATH}} -DHARD_FLOAT=${{matrix.hf_option}}
- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Upload
uses: actions/upload-artifact@v3
with:
name: SysY-compiler-${{matrix.os}}-hf${{matrix.hf_option}}
path: ${{github.workspace}}/build/sysy_compiler
upload:
runs-on: ubuntu-latest
needs: build
steps:
- name: Download SysY-compiler artifact
uses: actions/download-artifact@v3
with:
name: SysY-compiler-ubuntu-20.04-hfON
- name: Change permission
run: chmod +x sysy_compiler
- name: Zip it to tar.gz format
run: tar -zcvf sysy_compiler.tar.gz sysy_compiler
- name: Clone SysY-compiler-loader repository
uses: actions/checkout@v3
with:
github-server-url: ${{ secrets.XIJI_SERVER }}
repository: ${{ secrets.XIJI_REPO }}
ref: 'master'
path: 'loader'
token: ${{ secrets.XIJI_PAT }}
- name: Upload SysY-compiler to xiji gitlab server
run: |
cd loader
git config user.name github-actions
git config user.email github-actions@github.com
git checkout --orphan tmp
rm sysy_compiler.tar.gz
mv ../sysy_compiler.tar.gz .
git add -A
git commit -m "update SysY-compiler"
git branch -D master
git branch -m master
git reflog expire --expire=now --all
git gc --prune=now --aggressive
git push -f origin master