Skip to content

Commit

Permalink
Run integration tests for every distro on PR (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
andclt authored Jun 23, 2023
1 parent 40f98db commit 781b717
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 2 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/test-on-push-and-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,63 @@ jobs:
node-version: '16'
- name: Run 'pr' target
run: make pr

alpine:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up node
uses: actions/setup-node@v1
with:
node-version: '16'
- name: Run alpine integration tests
run: DISTRO=alpine make test-integ

amazonlinux:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up node
uses: actions/setup-node@v1
with:
node-version: '16'
- name: Run amazonlinux integration tests
run: DISTRO=amazonlinux make test-integ

centos:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up node
uses: actions/setup-node@v1
with:
node-version: '16'
- name: Run centos integration tests
run: DISTRO=centos make test-integ

debian:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up node
uses: actions/setup-node@v1
with:
node-version: '16'
- name: Run debian integration tests
run: DISTRO=debian make test-integ

ubuntu:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up node
uses: actions/setup-node@v1
with:
node-version: '16'
- name: Run ubuntu integration tests
run: DISTRO=ubuntu make test-integ
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ test-smoke: setup-codebuild-agent
CODEBUILD_IMAGE_TAG=codebuild-agent test/integration/codebuild-local/test_one.sh test/integration/codebuild/buildspec.os.alpine.1.yml alpine 3.16 18

test-integ: setup-codebuild-agent
CODEBUILD_IMAGE_TAG=codebuild-agent test/integration/codebuild-local/test_all.sh test/integration/codebuild
CODEBUILD_IMAGE_TAG=codebuild-agent DISTRO="$(DISTRO)" test/integration/codebuild-local/test_all.sh test/integration/codebuild

copy-files:
npm run copy-files
Expand Down
3 changes: 2 additions & 1 deletion test/integration/codebuild-local/test_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
set -euo pipefail

CODEBUILD_IMAGE_TAG="${CODEBUILD_IMAGE_TAG:-al2/x86_64/standard/3.0}"
DISTRO="${DISTRO:=""}"
DRYRUN="${DRYRUN-0}"

function usage {
Expand Down Expand Up @@ -54,7 +55,7 @@ main() {

BUILDSPEC_YML_DIR="$1"
HAS_YML=0
for f in "$BUILDSPEC_YML_DIR"/*.yml ; do
for f in "$BUILDSPEC_YML_DIR"/*"$DISTRO"*.yml ; do
[ -f "$f" ] || continue;
do_one_yaml "$f"
HAS_YML=1
Expand Down

0 comments on commit 781b717

Please sign in to comment.