add manual build #18
This file contains 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: Docker Actions | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Docker Compose | |
run: | | |
sudo rm /usr/local/bin/docker-compose | |
curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /tmp/docker-compose | |
chmod +x /tmp/docker-compose | |
sudo mv /tmp/docker-compose /usr/local/bin/docker-compose | |
- name: Start localstack | |
run: docker-compose up -d localstack | |
- name: Build docker image | |
run: docker build -t e2e-tests-sls . | |
- name: Run tests | |
run: docker run \ | |
--restart=on-failure \ | |
--env LOCALSTACK_HOST=localstack \ | |
--env AWS_ACCESS_KEY_ID=test \ | |
--env AWS_SECRET_ACCESS_KEY=test \ | |
--network default \ | |
e2e-tests-sls \ | |
npm run test | |
- name: Clean up | |
run: docker-compose down --volumes |