tutorial:githubactions

This is an old revision of the document!


Github Actions

Github Actions is a continuous integration and continuous delivery (CI/CD) platform that allows you to automate your build, test, and deployment pipeline. Some PSP developers may be interested in using their project with Github Actions for larger projects and for automatic updates to their software. It's also valuable in determining what changes may be breaking.

Github Actions is free with unlimited minutes for public projects, and up to 2000 free minutes per month for private repos (upgraded to 3000 with Github Pro).

In order to set up Github Actions, your program needs to already be hosted on Github. This is out of the scope of this guide, but you can find excellent tutorials through Github's "Hello World" Tutorial.

To add actions, browse to your repository, and in the main bar alongside other things like Issues or Pull Requests, you should see an “Actions” tab. To add your actions, you should use a custom action for simplicity. You will be brought to an editor where you can make changes to your YML file.

For your PSP build, you should run on ubuntu-latest and use the PSPDEV docker container.

name: PSP CI

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  build-psp:
    runs-on: ubuntu-latest
    container: pspdev/pspdev:latest

    steps:
      - name: Install dependencies
        run: |
          apk add cmake gmp mpc1 mpfr4 make
      - name: Checkout
        uses: actions/checkout@v2
      - name: Build
        run: | 
        # You can write whatever commands you need here
        # For this example, we're just running make
          make
      - name: Publish artifacts

Once you submit this file you should be set up for your PSP repository to be compiled automatically on commit and pull requests!

Here's a sample for compiling in Rust-PSP for Github Actions!

name: Rust-PSP

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v2
        
      - name: Install toolchain
        uses: actions-rs/toolchain@v1
        with:
          profile: default
          toolchain: nightly
          override: true
          components: rust-src
      
      - name: Install PSP
        uses: actions-rs/cargo@v1
        with:
          command: install
          args: cargo-psp
      
      - name: Build
        uses: actions-rs/cargo@v1
        with:
          command: psp
      
      - name: Upload a Build Artifact
        uses: actions/upload-artifact@v2.3.1
        with:
          name: psp_artifact # optional, default is artifact
          path: target/mipsel-sony-psp/debug/EBOOT.PBP
          if-no-files-found: warn # optional, default is warn
          retention-days: 30 # optional
  • tutorial/githubactions.1639585833.txt.gz
  • Last modified: 2021/12/15 16:30
  • by iridescence