From ce6097ea7ebf4d37abc6865c1afc806876e5e2f5 Mon Sep 17 00:00:00 2001 From: bbbradsmith Date: Mon, 8 May 2023 18:12:57 -0400 Subject: [PATCH 1/4] rename windows-test-manual to windows-test-scheduled --- .../{windows-test-manual.yml => windows-test-scheduled.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{windows-test-manual.yml => windows-test-scheduled.yml} (100%) diff --git a/.github/workflows/windows-test-manual.yml b/.github/workflows/windows-test-scheduled.yml similarity index 100% rename from .github/workflows/windows-test-manual.yml rename to .github/workflows/windows-test-scheduled.yml From 07963abd52ff5ccf3c5ef7790451454e1c0f3d0b Mon Sep 17 00:00:00 2001 From: bbbradsmith Date: Mon, 8 May 2023 18:21:21 -0400 Subject: [PATCH 2/4] replace manual-only tests with scheduled test and manual dispatch cache is used to prevent unnecessary rebuild if the previous build was successful make steps now use SHELL=cmd to provide cmd.exe subshell --- .github/workflows/windows-test-scheduled.yml | 48 +++++++++++++++++--- 1 file changed, 42 insertions(+), 6 deletions(-) diff --git a/.github/workflows/windows-test-scheduled.yml b/.github/workflows/windows-test-scheduled.yml index 854327726..c3516772b 100644 --- a/.github/workflows/windows-test-scheduled.yml +++ b/.github/workflows/windows-test-scheduled.yml @@ -1,8 +1,16 @@ -name: Windows Test Manual -# Manually dispatched because it's much slower than the Linux test. +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: @@ -10,34 +18,62 @@ jobs: 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 + 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 + run: make lib QUIET=1 SHELL=cmd + # make -j2 lib fails with SHELL=cmd (not sure why) - name: Run the regression tests (make test) + if: steps.check-sha.outputs.cache-hit != 'true' shell: cmd - run: make test QUIET=1 + 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 + run: make -j2 samples SHELL=cmd From 76328da6824493b75a0d9863c1730e0dcf418ad5 Mon Sep 17 00:00:00 2001 From: bbbradsmith Date: Mon, 8 May 2023 20:57:50 -0400 Subject: [PATCH 3/4] librsc/Makefile: ../lib directory must be created globally before make lib targets in parallel prevents conflict of individual targets each trying to create ../lib enable -j2 in make lib windows action --- .github/workflows/windows-test-scheduled.yml | 3 +-- libsrc/Makefile | 10 ++++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/windows-test-scheduled.yml b/.github/workflows/windows-test-scheduled.yml index c3516772b..451b37f79 100644 --- a/.github/workflows/windows-test-scheduled.yml +++ b/.github/workflows/windows-test-scheduled.yml @@ -65,8 +65,7 @@ jobs: - name: Build the platform libraries (make lib) if: steps.check-sha.outputs.cache-hit != 'true' shell: cmd - run: make lib QUIET=1 SHELL=cmd - # make -j2 lib fails with SHELL=cmd (not sure why) + run: make -j2 lib QUIET=1 SHELL=cmd - name: Run the regression tests (make test) if: steps.check-sha.outputs.cache-hit != 'true' diff --git a/libsrc/Makefile b/libsrc/Makefile index 732fa1d0e..0873d019f 100644 --- a/libsrc/Makefile +++ b/libsrc/Makefile @@ -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) - $( Date: Mon, 8 May 2023 21:22:18 -0400 Subject: [PATCH 4/4] remove workflow comments this obsoletes --- .github/workflows/build-on-pull-request.yml | 4 ---- .github/workflows/snapshot-on-push-master.yml | 4 ---- 2 files changed, 8 deletions(-) diff --git a/.github/workflows/build-on-pull-request.yml b/.github/workflows/build-on-pull-request.yml index 1ad810382..55be5db1e 100644 --- a/.github/workflows/build-on-pull-request.yml +++ b/.github/workflows/build-on-pull-request.yml @@ -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. diff --git a/.github/workflows/snapshot-on-push-master.yml b/.github/workflows/snapshot-on-push-master.yml index 6ba6b63ed..2aedb0e25 100644 --- a/.github/workflows/snapshot-on-push-master.yml +++ b/.github/workflows/snapshot-on-push-master.yml @@ -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'