diff --git a/.github/workflows/build-on-pull-request.yml b/.github/workflows/build-on-pull-request.yml index 05d6a4a39..55be5db1e 100644 --- a/.github/workflows/build-on-pull-request.yml +++ b/.github/workflows/build-on-pull-request.yml @@ -43,6 +43,11 @@ jobs: - name: Build the document files. shell: bash run: make -j2 doc + - name: Upload a documents snapshot. + uses: actions/upload-artifact@v3 + with: + name: docs + path: ./html - name: Build 64-bit Windows versions of the tools. run: | make -C src clean diff --git a/.github/workflows/snapshot-on-push-master.yml b/.github/workflows/snapshot-on-push-master.yml index e8be4400e..2aedb0e25 100644 --- a/.github/workflows/snapshot-on-push-master.yml +++ b/.github/workflows/snapshot-on-push-master.yml @@ -86,20 +86,24 @@ jobs: mv cc65.zip cc65-snapshot-win32.zip - name: Upload a 32-bit Snapshot Zip - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: - name: cc65-snapshot-win32.zip + name: cc65-snapshot-win32 path: cc65-snapshot-win32.zip - name: Upload a 64-bit Snapshot Zip - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: - name: cc65-snapshot-win64.zip + name: cc65-snapshot-win64 path: cc65-snapshot-win64.zip - name: Get the online documents repo. uses: actions/checkout@v3 with: repository: cc65/doc + # this token will expire, if it does, generate a new one as decribed in https://github.com/cc65/cc65/issues/2065 + # - apparently only a "classic" token works here + # - the token must exist in the cc65/cc65 repo + token: ${{ secrets.DOC_PAT }} # use secret token instead of default path: doc.git - name: Update the online documents. run: | @@ -110,11 +114,19 @@ jobs: git config user.email "cc65.nomail@github.com" git config push.default simple git add -A - git commit -m "Updated from cc65 commit ${GITHUB_SHA}." - #git push -v + # prevent failure when there is nothing to commit + git diff-index --quiet HEAD || git commit -m "Updated from https://github.com/cc65/cc65/commit/${GITHUB_SHA}" + git push + - name: Package offline documents. + run: 7z a cc65-snapshot-docs.zip ./html/*.* + - name: Upload a Documents Snapshot Zip + uses: actions/upload-artifact@v3 + with: + name: cc65-snapshot-docs + path: cc65-snapshot-docs.zip # enter secrets under "repository secrets" - - name: Upload snapshot to sourceforge + - name: Upload 32-bit Windows snapshot to sourceforge uses: nogsantos/scp-deploy@master with: src: cc65-snapshot-win32.zip @@ -123,5 +135,14 @@ jobs: port: ${{ secrets.SSH_PORT }} user: ${{ secrets.SSH_USER }} key: ${{ secrets.SSH_KEY }} + - name: Upload documents snapshot to sourceforge + uses: nogsantos/scp-deploy@master + with: + src: cc65-snapshot-docs.zip + host: ${{ secrets.SSH_HOST }} + remote: ${{ secrets.SSH_DIR }} + port: ${{ secrets.SSH_PORT }} + user: ${{ secrets.SSH_USER }} + key: ${{ secrets.SSH_KEY }} # TODO: Publish snapshot zip at https://github.com/cc65/cc65.github.io diff --git a/.github/workflows/windows-test-scheduled.yml b/.github/workflows/windows-test-scheduled.yml new file mode 100644 index 000000000..451b37f79 --- /dev/null +++ b/.github/workflows/windows-test-scheduled.yml @@ -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 diff --git a/Contributing.md b/Contributing.md index eb26e920b..3b355373c 100644 --- a/Contributing.md +++ b/Contributing.md @@ -74,10 +74,12 @@ color := $0787 The following is still very incomplete - if in doubt please look at existing sourcefiles and adapt to the existing style -* Your files should obey the C89 standard. +* Your files should generally obey the C89 standard, with a few C99 things (this is a bit similar to what cc65 itself supports). The exceptions are: + * use stdint.h for variables that require a certain bit size + * In printf-style functions use the PRIX64 (and similar) macros to deal with 64bit values (from inttypes.h) +This list is not necessarily complete - if in doubt, please ask. * We generally have a "no warnings" policy -* Warnings must not be hidden by using typecasts - fix the code instead - * In printf-style functions use the PRIX64 (and similar) macros to deal with 64bit values + * Warnings must not be hidden by using typecasts - fix the code instead * The normal indentation width should be four spaces. * You must use ANSI C comments (```/* */```); you must not use C++ comments (```//```). * When you add functions to an existing file, you should separate them by the same number of blank lines that separate the functions that already are in that file. diff --git a/Makefile b/Makefile index 909de81ec..29fcbbf96 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,7 @@ mostlyclean clean: avail unavail bin: @$(MAKE) -C src --no-print-directory $@ -lib: +lib libtest: @$(MAKE) -C libsrc --no-print-directory $@ doc html info: @@ -43,7 +43,7 @@ util: checkstyle: @$(MAKE) -C .github/checks --no-print-directory $@ -# simple "test" target, only run regression tests for c64 target +# runs regression tests, requires libtest target libraries test: @$(MAKE) -C test --no-print-directory $@ diff --git a/asminc/cx16.inc b/asminc/cx16.inc index be63780c8..d264add38 100644 --- a/asminc/cx16.inc +++ b/asminc/cx16.inc @@ -259,7 +259,7 @@ NLINES := $0387 ; Number of screen lines ; BASIC VARTAB := $03E1 ; Pointer to start of BASIC variables -MEMSIZE := $03E9 ; Pointer to highest BASIC RAM location (+1) +MEMSIZE := $0259 ; Pointer to highest BASIC RAM location (+1) ; --------------------------------------------------------------------------- ; Vector and other locations diff --git a/doc/ca65.sgml b/doc/ca65.sgml index 258808998..b4ef3e188 100644 --- a/doc/ca65.sgml +++ b/doc/ca65.sgml @@ -1409,10 +1409,6 @@ either a string or an expression value. .endmacro - This command is new and must be enabled with the - .BANK