Skip to content

Commit 8f8b2c0

Browse files
authored
Merge pull request #13 from Geod24/actions
Add a CI via Github actions
2 parents 88438e8 + 8286548 commit 8f8b2c0

3 files changed

Lines changed: 309 additions & 270 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

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ https://digitalmars.com/ctg/sc.html
1717
4. Change directory to `dm\src\dmc`
1818
5. Make sure the `dm\bin\make.exe` program is on your `PATH`.
1919
6. Execute the commands:
20-
`make clean`
21-
`make scppn`
20+
`make CC=dmc clean`
21+
`make CC=dmc scppn`
2222
You might need to edit the `makefile` to set the path to your DMD installation.
2323

2424
Note that DMC runs on Win32, and hasn't been ported to other platforms.

0 commit comments

Comments
 (0)