blob: d62bc1ec91b54a0a799d5bb9932db0d3ec36077c [file] [log] [blame]
Mohammed Naser9a5ff202022-09-07 15:56:48 -04001name: integration
2
3concurrency:
4 group: ${{ github.head_ref || github.run_id }}
5 cancel-in-progress: true
6
7on:
8 pull_request:
9 types:
10 - opened
11 - synchronize
12 - reopened
13 paths:
14 - .github/workflows/integration.yml
Mohammed Naserd06bfed2022-09-21 16:46:21 -040015 - atmosphere/**
Mohammed Naser9a5ff202022-09-07 15:56:48 -040016 - molecule/**
17 - playbooks/**
18 - plugins/**
19 - roles/**
20 push:
21 branches:
22 - main
23 paths:
24 - .github/workflows/integration.yml
Mohammed Naserd06bfed2022-09-21 16:46:21 -040025 - atmosphere/**
Mohammed Naser9a5ff202022-09-07 15:56:48 -040026 - molecule/**
27 - playbooks/**
28 - plugins/**
29 - roles/**
30
31jobs:
32 molecule:
33 runs-on: ubuntu-latest
34 steps:
Mohammed Nasere50b6b52022-09-21 16:05:56 -040035 - name: Install QEMU static binaries
36 uses: docker/setup-qemu-action@v2
37
38 - name: Configure Buildkit
39 uses: docker/setup-buildx-action@v2
40
Mohammed Naser9a5ff202022-09-07 15:56:48 -040041 - name: Checkout project
42 uses: actions/checkout@v3.0.2
43
44 - name: Set up Go
45 uses: actions/setup-go@v3.3.0
46 with:
47 go-version-file: go.mod
48 cache: true
49
Mohammed Naser6d1f1b22022-09-21 15:41:53 -040050 - name: Authenticate with Quay.io
51 uses: docker/login-action@v2
52 if: ${{ github.event_name == 'push' }}
53 with:
54 registry: quay.io
55 username: ${{ secrets.QUAY_USERNAME }}
56 password: ${{ secrets.QUAY_ROBOT_TOKEN }}
57
58 - name: Build image
59 uses: docker/build-push-action@v3
60 with:
61 cache-from: type=gha
62 cache-to: type=gha,mode=max
63 context: .
64 platforms: linux/amd64
65 push: ${{ github.event_name == 'push' }}
66 tags: quay.io/vexxhost/atmosphere:${{ github.sha }}
67
Mohammed Naser9a5ff202022-09-07 15:56:48 -040068 - name: Clean-up stale stacks
69 run: go run ./cmd/atmosphere-ci molecule cleanup
70 env:
71 OS_AUTH_URL: https://auth.vexxhost.net/v3
72 OS_REGION_NAME: ca-ymq-1
73 OS_USER_DOMAIN_NAME: Default
74 OS_USERNAME: ${{ secrets.OS_USERNAME }}
75 OS_PASSWORD: ${{ secrets.OS_PASSWORD }}
76 OS_PROJECT_DOMAIN_NAME: Default
77 OS_PROJECT_NAME: ${{ secrets.OS_PROJECT_NAME }}
78
dependabot[bot]5ea722f2022-09-12 03:46:06 +000079 - uses: gofrolist/molecule-action@v2.2.41
Mohammed Naser9a5ff202022-09-07 15:56:48 -040080 timeout-minutes: 90
81 env:
82 ATMOSPHERE_STACK_NAME: "atmosphere-${{ github.run_id }}-${{ github.run_attempt }}"
83 OS_AUTH_URL: https://auth.vexxhost.net/v3
84 OS_REGION_NAME: ca-ymq-1
85 OS_USER_DOMAIN_NAME: Default
86 OS_USERNAME: ${{ secrets.OS_USERNAME }}
87 OS_PASSWORD: ${{ secrets.OS_PASSWORD }}
88 OS_PROJECT_DOMAIN_NAME: Default
89 OS_PROJECT_NAME: ${{ secrets.OS_PROJECT_NAME }}
Mohammed Naser6d1f1b22022-09-21 15:41:53 -040090
91 - name: Promote image
92 uses: akhilerm/tag-push-action@v2.0.0
93 if: github.ref == 'refs/heads/main'
94 with:
95 src: quay.io/vexxhost/atmosphere:${{ github.sha }}
96 dst: quay.io/vexxhost/atmosphere:latest