This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
dagger/.github/workflows/test-universe.yml
Gerhard Lazu bcd175e5eb
Use paths instead of paths-ignore for trigerring actions
Andrea made some great suggestions, thanks!

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2022-02-04 12:18:21 +00:00

122 lines
3.1 KiB
YAML

name: "Test Universe"
on:
push:
branches: [main]
paths:
- '**.sh'
- '**.bash'
- '**.go'
- '**.cue'
- 'Makefile'
- 'go.mod'
- 'go.sum'
- '.github/workflows/test-universe.yml'
pull_request:
branches: [main]
paths:
- '**.sh'
- '**.bash'
- '**.go'
- '**.cue'
- 'Makefile'
- 'go.mod'
- 'go.sum'
- '.github/workflows/test-universe.yml'
jobs:
universe:
name: Universe
runs-on: ubuntu-latest
timeout-minutes: 30
services:
localstack:
image: localstack/localstack:0.12.16
env:
SERVICES: s3, ecr
LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }}
ports:
- 4566:4566
- 4571:4571
- 4510:4510
options: >-
--health-cmd "curl -f http://localhost:4566/health"
--health-start-period 5s
--health-timeout 5s
--health-interval 5s
--health-retries 10
steps:
- name: "Check out"
uses: actions/checkout@v2
- name: "Setup Go"
uses: actions/setup-go@v1
with:
go-version: 1.16
- name: "Setup KiND"
uses: helm/kind-action@v1.2.0
- name: "Import Dagger private key"
env:
DAGGER_AGE_KEY: ${{ secrets.DAGGER_AGE_KEY }}
run: |
mkdir -p ~/.config/dagger
echo "$DAGGER_AGE_KEY" > ~/.config/dagger/keys.txt
- name: "Provision Localstack AWS resources"
env:
AWS_ACCESS_KEY_ID: test
AWS_SECRET_ACCESS_KEY: test
AWS_DEFAULT_REGION: us-east-2
run: |
aws --endpoint-url=http://localhost:4566 s3 mb s3://dagger-ci
aws --endpoint-url=http://localhost:4566 ecr create-repository --repository-name dagger-ci
- name: "Expose GitHub Runtime"
uses: crazy-max/ghaction-github-runtime@v1
- name: Test
# TODO: https://github.com/dagger/dagger/pull/1341
# env:
# DAGGER_CACHE_TO: "type=gha,mode=max,scope=test-universe"
# DAGGER_CACHE_FROM: "type=gha,mode=max,scope=test-universe"
run: |
make universe-test
universe-europa:
name: "Universe - Europa"
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: "Check out"
uses: actions/checkout@v2
- name: "Set up Go"
uses: actions/setup-go@v1
with:
go-version: 1.16
- name: "Install SOPS"
run: |
sudo curl -L -o /usr/local/bin/sops https://github.com/mozilla/sops/releases/download/v3.7.1/sops-v3.7.1.linux
sudo chmod +x /usr/local/bin/sops
- name: "Import Dagger private key"
env:
DAGGER_AGE_KEY: ${{ secrets.DAGGER_AGE_KEY }}
run: |
mkdir -p ~/.config/sops/age
echo "$DAGGER_AGE_KEY" > ~/.config/sops/age/keys.txt
- name: "Expose GitHub Runtime"
uses: crazy-max/ghaction-github-runtime@v1
- name: Test
env:
DAGGER_CACHE_TO: "type=gha,mode=max,scope=test-universe"
DAGGER_CACHE_FROM: "type=gha,mode=max,scope=test-universe"
run: |
make europa-universe-test