Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jedeoric committed Oct 28, 2024
1 parent d2e65bc commit 9d7f350
Showing 1 changed file with 108 additions and 29 deletions.
137 changes: 108 additions & 29 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: build
on:
# Triggers the workflow on push event only for all branches
push:
branches: [ main, master, develop ]
# branches: [ main, master ]
#pull_request:
# branches: [ main, master ]

Expand All @@ -14,37 +14,46 @@ on:
jobs:
# This workflow contains a single job called "build"
setup-sdk:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

steps:
- name: Cache sdk
id: cache-sdk
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
cc65/**/*
orix-sdk/**/*
md2hlp/**/*
orix-software/**/*
key: ${{ secrets.CACHE_ID }}-orix-sdk_
bpm/**/*
oricutron/**/*
key: ${{ secrets.CACHE_ID }}-orix-sdk

- name: Checkout cc65
if: steps.cache-sdk.outputs.cache-hit != 'true'
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: cc65/cc65
path: cc65

- name: Checkout bpm
#if: steps.cache-sdk.outputs.cache-hit != 'true'
uses: actions/checkout@v3
with:
repository: orix-software/bpm
path: bpm

- name: Checkout orix-sdk
if: steps.cache-sdk.outputs.cache-hit != 'true'
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: assinie/orix-sdk
path: orix-sdk

- name: Checkout md2hlp
if: steps.cache-sdk.outputs.cache-hit != 'true'
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: assinie/md2hlp
path: md2hlp
Expand All @@ -68,6 +77,14 @@ jobs:
echo "src/include" >> .git/info/sparse-checkout
git checkout
- name: Prepare environment for oricutron
if: steps.cache-sdk.outputs.cache-hit != 'true'
run: |
sudo apt-get install -y xvfb libgtk-3-0 libgtk-3-dev libsdl1.2debian libsdl1.2-dev
git clone https://github.com/pete-gordon/oricutron.git
cd oricutron && make && pwd && cd .. && ls -l && echo ${GITHUB_WORKSPACE}
echo Timeout oricutron : ${secret}.TMOUT_ORICUTRON
- name: Compile orix-sdk
if: steps.cache-sdk.outputs.cache-hit != 'true'
working-directory: orix-sdk
Expand All @@ -83,49 +100,94 @@ jobs:
build:
# The type of runner that the job will run on
needs: setup-sdk
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
outputs:
version: ${{ steps.job_vars.outputs.VERSION }}
repo_name: ${{ steps.job_vars.outputs.REPO_NAME }}
bpm_found: ${{ steps.bpm_upload.outputs.BPM_FOUND }}

steps:
- name: Checkout repository and submodules
uses: actions/checkout@v3
# Remove recursive
with:
submodules: recursive
- uses: actions/checkout@v3

- name: Set job variables
id: job_vars
run: |
echo "::set-output name=VERSION::$(cat VERSION)"
echo "::set-output name=REPO_NAME::${GITHUB_REPOSITORY##*/}"
echo "VERSION=$(cat VERSION)" >> $GITHUB_OUTPUT
echo "REPO_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_OUTPUT
- name: Install sdk
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
cc65/**/*
orix-sdk/**/*
md2hlp/**/*
orix-software/**/*
key: ${{ secrets.CACHE_ID }}-orix-sdk_
bpm/**/*
oricutron/**/*
key: ${{ secrets.CACHE_ID }}-orix-sdk

- name: Prepare environment for project
run: mv cc65 ../ && mv orix-software ../ && mv orix-sdk ../ && mv md2hlp ../
run: |
mkdir ~/bin
cd bpm && pip install -r requirements.txt && cd ..
# cp bpm/src/bpm ~/bin
# chmod 755 ~/bin/bpm && export PATH=$PATH:~/bin
ls -l && ls -l .. && ls -l ~/bin/ && mv cc65 ../ && mv orix-software ../ && mv orix-sdk ../ && mv md2hlp ../ && mv bpm ../
- name: Compile project
run: |
ls -l
echo $CC65_HOME
ls -l $CC65_HOME
CC65_HOME=${GITHUB_WORKSPACE}/../cc65 make
if [ -f "bpm.tml" ]; then
ls -l ${GITHUB_WORKSPACE}
ls -l ${GITHUB_WORKSPACE}/oricutron
echo "Workspace : ${GITHUB_WORKSPACE}"
CC65_HOME=${GITHUB_WORKSPACE}/../cc65
echo "../bpm/src/bpm" >> $GITHUB_PATH
echo ${GITHUB_WORKSPACE}/../cc65/bin >> $GITHUB_PATH
export PATH=$PATH:../bpm/src/:${GITHUB_WORKSPACE}/../cc65/bin
chmod 755 ../bpm/src/bpm
echo "/home/runner/work/file/cc65/bin" >> $GITHUB_PATH
echo "Bpm version :"
bpm --force-update -V
bpm --force-update -V
echo Using bpm ...
bpm --force-update plugins install orixsdk
bpm --force-update build
else
CC65_HOME=${GITHUB_WORKSPACE}/../cc65 make
fi
- name: Unit-test with oricutron
run: |
echo "Workspace : ${GITHUB_WORKSPACE}"
echo Checking if there is unit tests
if [ -d "tests/build/" ] && [ "$(ls -A tests/build/)" ]; then
echo "########################################################"
echo "# Unit tests found : Starting Oricutron with tests #"
echo "########################################################"
git clone https://github.com/orix-software/docker-unit-test.git
cd docker-unit-test && bash install.sh ${GITHUB_WORKSPACE} && cd ..
echo "Tests found, let's start"
cp tests/build/* > ${GITHUB_WORKSPACE}/oricutron/sdcard/BIN
echo "#!/bin/submit\n" > ${GITHUB_WORKSPACE}/oricutron/sdcard/ETC/AUTOBOOT
cp tests/run.sub >> ${GITHUB_WORKSPACE}/oricutron/sdcard/ETC/AUTOBOOT
cd ${GITHUB_WORKSPACE}/oricutron
echo "Start Oricutron"
timeout --preserve-status 10 ./xvfb.sh || exit 0
fi
- name: Check unit-test
run: |
if [ -d "tests/build/" ] && [ "$(ls -A tests/build/)" ]; then
ls -l ${GITHUB_WORKSPACE}/oricutron/sdcard/
bash tests/unit-tests/verify.sh ${GITHUB_WORKSPACE}/oricutron/sdcard/
fi
- name: List build directory content
run: ls -lR build

- name: Upload Artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: ${{ steps.job_vars.outputs.REPO_NAME }}
path: |
Expand All @@ -135,16 +197,27 @@ jobs:
- name: Post compilation
run: mv ../cc65 . && mv ../orix-software . && mv ../orix-sdk . && mv ../md2hlp .

- name: Upload if bpm
id: bpm_upload
run: |
if [ -f "bpm.tml" ]; then
export BPM_PUBLISH_KEY=$hash
export PATH=$PATH:../bpm/src/:${GITHUB_WORKSPACE}/../cc65/bin
if [ "$BRANCH_NAME" = "master" -o "$BRANCH_NAME" = "main" ]; then bpm --force-update -V;--force-update publish --official; else bpm publish --alpha; fi
echo "BPM_FOUND=True" >> $GITHUB_OUTPUT
fi
upload:
needs: build
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
defaults:
run:
shell: bash
env:
hash: ${{ secrets.HASH }}
version: ${{ needs.build.outputs.version }}
repo_name: ${{ needs.build.outputs.repo_name }}
BPM_FOUND: ${{ needs.build.outputs.bpm_found }}

steps:
- name: Get branch name
Expand All @@ -163,17 +236,23 @@ jobs:
# On pourrait faire l'extraction directement à la racine si VERSION est dans l'artifact
- name: Download Artifact
id: download
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: ${{ needs.build.outputs.repo_name }}
path: artifact

- name: Make archive
working-directory: ${{steps.download.outputs.download-path}}
run: tar -zcvf $GITHUB_WORKSPACE/$ARCHIVE_NAME *
run: |
echo "Use tar for archive"
tar -zcvf $GITHUB_WORKSPACE/$ARCHIVE_NAME *
- name: Upload to oric
run: |
if [ "$BRANCH_NAME" = "master" -o "$BRANCH_NAME" = "main" ]; then VERSION="$version"; else VERSION=alpha ; fi
curl -X POST --data-binary "@${ARCHIVE_NAME}" "https://cdn.oric.org/publish.php?hash=$hash&path=/home/oricoujr/www/ftp/orix/dists/$VERSION/tgz/6502/${ARCHIVE_NAME}"
echo BPM $BPM_FOUND
if [ "$BPM_FOUND" != "True" ]; then
if [ "$BRANCH_NAME" = "master" -o "$BRANCH_NAME" = "main" ]; then VERSION="$version"; else VERSION=alpha; fi
curl -X POST --data-binary "@${ARCHIVE_NAME}" "https://cdn.oric.org/publish.php?hash=$hash&path=/home/oricoujr/www/ftp/orix/dists/$VERSION/tgz/6502/${ARCHIVE_NAME}"
else
echo "Skipped, already sent with bpm"
fi

0 comments on commit 9d7f350

Please sign in to comment.