name: test on: workflow_dispatch: push: jobs: use-action: runs-on: ${{ matrix.os }} strategy: matrix: os: [windows-latest, ubuntu-latest, macos-latest] steps: - name: Checkout repository uses: actions/checkout@v3.3.0 - name: Move test project to the working directory run: mv test/* . - name: Use this action uses: ./ - name: Run build result run: ${{ matrix.os == 'windows-latest' && 'build\Debug\hello_world.exe' || 'build/hello_world' }} use-action-with-specified-source-dir: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v3.3.0 - name: Use this action with specified source directory uses: ./ with: source-dir: test - name: Run build result run: build/hello_world use-action-with-specified-build-dir: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v3.3.0 - name: Use this action with specified build directory uses: ./ with: source-dir: test build-dir: test/build - name: Run build result run: test/build/hello_world - name: Check if default build directory is not exist run: test ! -d build use-action-with-additional-args: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v3.3.0 - name: Use this action with build txt enabled uses: ./ with: source-dir: test args: -D BUILD_TXT=ON - name: Run build result run: build/hello_world - name: Check if the txt result exist run: cat build/hello_world.txt