1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-07 23:29:39 +00:00

Merge pull request #2108 from bbbradsmith/windows-workflow-scheduled-cmd

Scheduled windows build/test and cmd.exe subshell
This commit is contained in:
Bob Andrews 2023-05-16 15:37:18 +02:00 committed by GitHub
commit d41f53e252
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 86 additions and 53 deletions

View File

@ -72,7 +72,3 @@ jobs:
- name: Build app (release)
run: msbuild src\cc65.sln -t:rebuild -property:Configuration=Release
# The regression tests are currently too slow to run for this Windows build,
# but the "Windows Test Manual" workflow (windows-test-manual.yml) can by
# manually dispatched from the Actions menu to test as needed.

View File

@ -29,10 +29,6 @@ jobs:
- name: Build app (release)
run: msbuild src\cc65.sln -t:rebuild -property:Configuration=Release
# The regression tests are currently too slow to run for this Windows build,
# but the "Windows Test Manual" workflow (windows-test-manual.yml) can by
# manually dispatched from the Actions menu to test as needed.
build_linux:
name: Build, Test, and Snapshot (Linux)
if: github.repository == 'cc65/cc65'

View File

@ -1,43 +0,0 @@
name: Windows Test Manual
# Manually dispatched because it's much slower than the Linux test.
on:
workflow_dispatch:
jobs:
build_windows:
name: Build, Test (Windows MSVC)
runs-on: windows-latest
steps:
- name: Git Setup
shell: bash
run: git config --global core.autocrlf input
- name: Checkout source
uses: actions/checkout@v3
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.1
- name: Build app (MSVC debug)
run: msbuild src\cc65.sln -t:rebuild -property:Configuration=Debug
- name: Build app (MSVC release)
run: msbuild src\cc65.sln -t:rebuild -property:Configuration=Release
- name: Build utils (MinGW)
shell: cmd
run: make -j2 util
- name: Build the platform libraries (make lib)
shell: cmd
run: make -j2 lib QUIET=1
- name: Run the regression tests (make test)
shell: cmd
run: make test QUIET=1
- name: Test that the samples can be built (make samples)
shell: cmd
run: make -j2 samples

View File

@ -0,0 +1,78 @@
name: Windows Test Scheduled
# Scheduled or manually dispatched because it's slower than the Linux test.
on:
schedule:
- cron: '0 0 */1 * *'
# every 1 days
workflow_dispatch:
# allow manual dispatch
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# don't run more than once at a time
jobs:
build_windows:
name: Build, Test (Windows MSVC)
runs-on: windows-latest
steps:
# This cache is used to remember the last build.
# If there are no changes and the last build was successful,
# the build and test steps will be omitted.
# If the last build failed, the full attempt will be repeated.
# Github Actions will retain the last build cache for up to 7 days.
- name: Create Cache
shell: bash
run: mkdir ~/.cache-sha
- name: Cache SHA
uses: actions/cache@v3
id: check-sha
with:
path: ~/.cache-sha
key: cache-sha-wintest-${{ github.sha }}
- name: Git Setup
if: steps.check-sha.outputs.cache-hit != 'true'
shell: bash
run: git config --global core.autocrlf input
- name: Checkout source
if: steps.check-sha.outputs.cache-hit != 'true'
uses: actions/checkout@v3
- name: Add msbuild to PATH
if: steps.check-sha.outputs.cache-hit != 'true'
uses: microsoft/setup-msbuild@v1.1
- name: Build app (MSVC debug)
if: steps.check-sha.outputs.cache-hit != 'true'
run: msbuild src\cc65.sln -t:rebuild -property:Configuration=Debug
- name: Build app (MSVC release)
if: steps.check-sha.outputs.cache-hit != 'true'
run: msbuild src\cc65.sln -t:rebuild -property:Configuration=Release
- name: Build utils (MinGW)
if: steps.check-sha.outputs.cache-hit != 'true'
shell: cmd
run: make -j2 util SHELL=cmd
- name: Build the platform libraries (make lib)
if: steps.check-sha.outputs.cache-hit != 'true'
shell: cmd
run: make -j2 lib QUIET=1 SHELL=cmd
- name: Run the regression tests (make test)
if: steps.check-sha.outputs.cache-hit != 'true'
shell: cmd
run: make test QUIET=1 SHELL=cmd
- name: Test that the samples can be built (make samples)
if: steps.check-sha.outputs.cache-hit != 'true'
shell: cmd
run: make -j2 samples SHELL=cmd

View File

@ -122,9 +122,13 @@ endef # ZIP_recipe
zip:
$(foreach dir,$(OUTPUTDIRS),$(ZIP_recipe))
$(TARGETS):
$(TARGETS): | ../lib
@$(MAKE) --no-print-directory $@
# ../lib must be created globally before doing lib targets in parallel
../lib:
@$(call MKDIR,$@)
else # TARGET
CA65FLAGS =
@ -293,10 +297,12 @@ $(EXTRA_OBJPAT): $(EXTRA_SRCPAT) | ../libwrk/$(TARGET) ../lib
@echo $(TARGET) - $(<F)
@$(CA65) -t $(TARGET) $(CA65FLAGS) --create-dep $(@:../lib/%.o=../libwrk/$(TARGET)/%.d) -o $@ $<
$(EXTRA_OBJS): | ../lib
../lib/$(TARGET).lib: $(OBJS) | ../lib
$(AR65) a $@ $?
../libwrk/$(TARGET) ../lib ../target/$(TARGET)/util:
../libwrk/$(TARGET) ../target/$(TARGET)/util:
@$(call MKDIR,$@)
$(TARGET): $(EXTRA_OBJS) ../lib/$(TARGET).lib