name: Linux arm64
run-name: Build And Test

on: 
  push:
    branches:
      - main
  pull_request:
    branches:
      - main

jobs:
  Build:
    runs-on: ubuntu-latest
    steps:
      - name: Check out repository code
        uses: actions/checkout@v3

      - name: Packages cache
        uses: actions/cache@v4
        with:
          path: ${{ github.workspace }}/build/.packages
          key: ${{ runner.os }}-xmake_cache

      - name: XMake config
        run: xmake f -p linux -y

      - name: Build
        run: xmake

      - name: Test
        run: xmake test