Skip to content

Commit 8286548

Browse files
committed
Add a CI via Github actions
1 parent f84623c commit 8286548

1 file changed

Lines changed: 56 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: CI
2+
3+
on: [ pull_request, push ]
4+
5+
jobs:
6+
main:
7+
name: Run
8+
# DMC only supports Win32
9+
runs-on: windows-2019
10+
steps:
11+
- uses: dlang-community/setup-dlang@v1
12+
with:
13+
compiler: dmd-2.092.0
14+
- uses: actions/checkout@v2
15+
16+
# Restore or install dmc (and DM make)
17+
# Copied from druntime, keep it in sync
18+
- name: '[Windows] Restore dmc from cache'
19+
id: cache-dmc
20+
if: runner.os == 'Windows'
21+
uses: actions/cache@v1
22+
with:
23+
path: ${{ github.workspace }}/tools/
24+
key: dmc857
25+
26+
- name: '[Windows] Install dmc'
27+
if: runner.os == 'Windows' && steps.cache-dmc.outputs.cache-hit != 'true'
28+
shell: powershell
29+
run: |
30+
$url = "http://ftp.digitalmars.com/Digital_Mars_C++/Patch/dm857c.zip"
31+
$sha256hash = "aabd977b83134d38615e56d105ea1f505778d1a3a29c88836b95ce2339b10057"
32+
Write-Host ('Downloading {0} ...' -f $url)
33+
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
34+
$ProgressPreference = 'SilentlyContinue'
35+
New-Item -ItemType directory -Path ${{ github.workspace }}\tools\
36+
Invoke-WebRequest -Uri $url -OutFile '${{ github.workspace }}\tools\dmc.zip'
37+
if ((Get-FileHash '${{ github.workspace }}\tools\dmc.zip' -Algorithm "SHA256").Hash -ne $sha256hash) {
38+
exit 1
39+
}
40+
Expand-Archive '${{ github.workspace }}\tools\dmc.zip' -DestinationPath '${{ github.workspace }}\tools\'
41+
42+
- name: 'Build compiler'
43+
shell: cmd
44+
run: |
45+
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars32.bat"
46+
47+
cd dm\src\dmc\
48+
${{ github.workspace }}\tools\dm\bin\make CC=${{ github.workspace }}\tools\dm\bin\dmc.exe TARGET=SCPP OPT=-o "DEBUG= -DSTATIC= -Nc" LFLAGS=/noi/noe/map/co scppn.exe
49+
50+
if %errorlevel% neq 0 exit /b %errorlevel%
51+
52+
- name: 'Upload artifact'
53+
uses: actions/upload-artifact@v2
54+
with:
55+
name: scppn
56+
path: dm/src/dmc/scppn.exe

0 commit comments

Comments
 (0)