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