Skip to content

Commit 6eda9cf

Browse files
authored
run makefile tests for every sample in a separate CI workflow (#247)
* take a stab * run actual tests now * set mindepth to 2: * fix comments
1 parent 88a671c commit 6eda9cf

File tree

2 files changed

+57
-64
lines changed

2 files changed

+57
-64
lines changed

.github/workflows/makefile.yml

Lines changed: 0 additions & 64 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Run tests for all samples
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
jobs:
12+
prepare-list:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- id: set-matrix
17+
run: |
18+
mapfile -t dirs < <(find . -mindepth 2 -type f -name "Makefile" ! -path "./sample-archive/*" | sed "s|/Makefile||" | sort)
19+
echo "matrix=$(printf '%s\n' "${dirs[@]}" | jq -R . | jq -cs .)" >> "$GITHUB_OUTPUT"
20+
21+
outputs:
22+
matrix: ${{ steps.set-matrix.outputs.matrix }}
23+
24+
run-tests:
25+
name: Run dependency test (${{ matrix.directory }})
26+
runs-on: ubuntu-latest
27+
needs: prepare-list
28+
strategy:
29+
fail-fast: false
30+
max-parallel: 8
31+
matrix:
32+
directory: ${{ fromJSON(needs.prepare-list.outputs.matrix) }}
33+
34+
steps:
35+
- uses: actions/checkout@v4
36+
- name: Setup Node.js
37+
uses: actions/setup-node@v4
38+
with:
39+
node-version: 18
40+
- name: Install LocalStack
41+
run: pip install localstack awscli-local[ver1] virtualenv
42+
- name: Setup config
43+
run: |
44+
echo "Configuring git for codecommit sample"
45+
git config --global user.email "localstack.sample@localstack.cloud"
46+
git config --global user.name "Localstack Pro-Samples"
47+
- name: Pull the latest docker image
48+
run: docker pull localstack/localstack-pro
49+
- name: Execute a simple test
50+
timeout-minutes: 10
51+
run: |
52+
cd ${{ matrix.directory }}
53+
make test-ci
54+
env:
55+
LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }}
56+
DEBUG: 1
57+
DNS_ADDRESS: 127.0.0.1

0 commit comments

Comments
 (0)