run makefile tests for every sample in a separate CI workflow (#247) #6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Run tests for all samples | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| branches: | |
| - master | |
| jobs: | |
| prepare-list: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - id: set-matrix | |
| run: | | |
| mapfile -t dirs < <(find . -mindepth 2 -type f -name "Makefile" ! -path "./sample-archive/*" | sed "s|/Makefile||" | sort) | |
| echo "matrix=$(printf '%s\n' "${dirs[@]}" | jq -R . | jq -cs .)" >> "$GITHUB_OUTPUT" | |
| outputs: | |
| matrix: ${{ steps.set-matrix.outputs.matrix }} | |
| run-tests: | |
| name: Run dependency test (${{ matrix.directory }}) | |
| runs-on: ubuntu-latest | |
| needs: prepare-list | |
| strategy: | |
| fail-fast: false | |
| max-parallel: 8 | |
| matrix: | |
| directory: ${{ fromJSON(needs.prepare-list.outputs.matrix) }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 18 | |
| - name: Install LocalStack | |
| run: pip install localstack awscli-local[ver1] virtualenv | |
| - name: Setup config | |
| run: | | |
| echo "Configuring git for codecommit sample" | |
| git config --global user.email "localstack.sample@localstack.cloud" | |
| git config --global user.name "Localstack Pro-Samples" | |
| - name: Pull the latest docker image | |
| run: docker pull localstack/localstack-pro | |
| - name: Execute a simple test | |
| timeout-minutes: 10 | |
| run: | | |
| cd ${{ matrix.directory }} | |
| make test-ci | |
| env: | |
| LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }} | |
| DEBUG: 1 | |
| DNS_ADDRESS: 127.0.0.1 |