From c745d776d0b74dc00f1985e7ac4be5696ec929f7 Mon Sep 17 00:00:00 2001 From: MeirGavish Date: Sat, 26 Jul 2025 01:40:33 +0300 Subject: [PATCH 1/3] Created Github Actions Build CI Test build_ci_workflow.yml --- .github/workflows/build_ci_workflow.yml | 60 +++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 .github/workflows/build_ci_workflow.yml diff --git a/.github/workflows/build_ci_workflow.yml b/.github/workflows/build_ci_workflow.yml new file mode 100644 index 0000000..b3bae1b --- /dev/null +++ b/.github/workflows/build_ci_workflow.yml @@ -0,0 +1,60 @@ +name: Build CI + +on: + push: + branches: + - '**' # Matches any branch + pull_request: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set devkitPro environment variables + run: | + # Installing to home directory to avoid permission denied on caching + echo "DEVKITPRO=/home/runner/devkitpro" >> $GITHUB_ENV + echo "DEVKITARM=/home/runner/devkitpro/devkitARM" >> $GITHUB_ENV + export PATH=$DEVKITARM/bin:$DEVKITPRO/tools/bin:$PATH + + # Caching to avoid excessive request to the server from a runner because they + # eventually result in permission denied 403 + - name: Cache devkitPro toolchain + id: cache-devkitpro + uses: actions/cache@v4 + with: + path: /home/runner/devkitpro + # Using a manual key version suffix - v{num}, if changes are made that make the + # cache stale and require a refresh, just bump the version number so there's + # a cache miss. The key needs to match in the "Save devkitPro to cache" stage + # so you need to bump the number there too... + key: devkitpro-${{ runner.os }}-v5 + + - name: Set up devkitARM (if not cached) + if: steps.cache-devkitpro.outputs.cache-hit != 'true' + run: | + sudo apt update + wget https://apt.devkitpro.org/install-devkitpro-pacman + chmod +x install-devkitpro-pacman + sudo ./install-devkitpro-pacman + mkdir -p "$DEVKITPRO" + sudo dkp-pacman -Sy --noconfirm gba-dev + # Copy from installed directory to cacheable directory + sudo cp -r /opt/devkitpro "/home/runner" + sudo chown -R $USER:$USER "/home/runner/devkitpro" + - name: Save devkitPro to cache + if: steps.cache-devkitpro.outputs.cache-hit != 'true' + uses: actions/cache/save@v4 + with: + path: /home/runner/devkitpro + key: devkitpro-${{ runner.os }}-5 + + - name: Build the project + run: | + make From b39d95ae2de9fb2cde7444316e0b0c7b0e49a532 Mon Sep 17 00:00:00 2001 From: MeirGavish Date: Sat, 26 Jul 2025 01:46:10 +0300 Subject: [PATCH 2/3] Reset cache key version to v1 and added more comments in build_ci_workflow.yml --- .github/workflows/build_ci_workflow.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_ci_workflow.yml b/.github/workflows/build_ci_workflow.yml index b3bae1b..31fb65c 100644 --- a/.github/workflows/build_ci_workflow.yml +++ b/.github/workflows/build_ci_workflow.yml @@ -23,8 +23,9 @@ jobs: echo "DEVKITARM=/home/runner/devkitpro/devkitARM" >> $GITHUB_ENV export PATH=$DEVKITARM/bin:$DEVKITPRO/tools/bin:$PATH - # Caching to avoid excessive request to the server from a runner because they - # eventually result in permission denied 403 + # Caching to avoid excessive request to the devkitpro server from a runner because they + # eventually block and result in permission denied 403. + # If that happens it takes like 2 hours until you can make requests again - name: Cache devkitPro toolchain id: cache-devkitpro uses: actions/cache@v4 @@ -34,7 +35,7 @@ jobs: # cache stale and require a refresh, just bump the version number so there's # a cache miss. The key needs to match in the "Save devkitPro to cache" stage # so you need to bump the number there too... - key: devkitpro-${{ runner.os }}-v5 + key: devkitpro-${{ runner.os }}-v1 - name: Set up devkitARM (if not cached) if: steps.cache-devkitpro.outputs.cache-hit != 'true' @@ -53,7 +54,7 @@ jobs: uses: actions/cache/save@v4 with: path: /home/runner/devkitpro - key: devkitpro-${{ runner.os }}-5 + key: devkitpro-${{ runner.os }}-v1 - name: Build the project run: | From 03e3d31e385735cb288476f8509c57b51f288304 Mon Sep 17 00:00:00 2001 From: MeirGavish Date: Sat, 26 Jul 2025 11:21:24 +0300 Subject: [PATCH 3/3] Fixed build_ci_workflow.yml to trigger on pull requests to main --- .github/workflows/build_ci_workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_ci_workflow.yml b/.github/workflows/build_ci_workflow.yml index 31fb65c..f720191 100644 --- a/.github/workflows/build_ci_workflow.yml +++ b/.github/workflows/build_ci_workflow.yml @@ -6,7 +6,7 @@ on: - '**' # Matches any branch pull_request: branches: - - master + - main jobs: build: