|
| 1 | +name: PostgreSQL Tests |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + |
| 6 | +jobs: |
| 7 | + leia-tests: |
| 8 | + runs-on: ${{ matrix.os }} |
| 9 | + env: |
| 10 | + TERM: xterm |
| 11 | + strategy: |
| 12 | + matrix: |
| 13 | + leia-tests: |
| 14 | + - examples/postgresql-9.3 |
| 15 | + - examples/postgresql-9.6 |
| 16 | + - examples/postgresql-10 |
| 17 | + - examples/postgresql-11 |
| 18 | + - examples/postgresql-12 |
| 19 | + - examples/postgresql-13 |
| 20 | + lando-versions: |
| 21 | + - edge |
| 22 | + os: |
| 23 | + - ubuntu-20.04 |
| 24 | + node-version: |
| 25 | + - '14' |
| 26 | + |
| 27 | + steps: |
| 28 | + # Install deps and cache |
| 29 | + - name: Checkout code |
| 30 | + uses: actions/checkout@v2 |
| 31 | + - name: Install node ${{ matrix.node-version }} |
| 32 | + uses: actions/setup-node@v2 |
| 33 | + with: |
| 34 | + node-version: ${{ matrix.node-version }} |
| 35 | + cache: yarn |
| 36 | + - name: Install Yarn dependencies |
| 37 | + run: yarn install --prefer-offline --frozen-lockfile |
| 38 | + |
| 39 | + # This block should eventually become use lando/actions-hyperdrive@v2 |
| 40 | + - name: Verify Docker dependencies |
| 41 | + run: | |
| 42 | + docker --version | grep "20.10." |
| 43 | + docker-compose --version | grep "1.29." |
| 44 | + - name: Grab latest edge Lando CLI |
| 45 | + run: | |
| 46 | + sudo curl -fsSL -o /usr/local/bin/lando "https://files.lando.dev/cli/lando-linux-x64-${{ matrix.lando-versions }}" |
| 47 | + sudo chmod +x /usr/local/bin/lando |
| 48 | + - name: Move in lando config appropriate for testing |
| 49 | + run: | |
| 50 | + mkdir -p ~/.lando/cache |
| 51 | + cp -f actions-lando-config.yml ~/.lando/config.yml |
| 52 | + echo false > ~/.lando/cache/report_errors |
| 53 | + lando --clear |
| 54 | + - name: Verify Lando works and we are dogfooding this plugin for tests |
| 55 | + run: | |
| 56 | + lando version |
| 57 | + lando config --path plugins | grep platformsh | grep /home/runner/work/platformsh/platformsh || echo "::error:: Not dogfooding this plugin correctly! " |
| 58 | + cd ${{ matrix.leia-tests }} |
| 59 | + lando config --path plugins | grep platformsh | grep dir | grep /home/runner/work/platformsh/platformsh || echo "::error:: Not dogfooding this plugin correctly! " |
| 60 | +
|
| 61 | + # This block should eventually become use lando/actions-leia@v2 |
| 62 | + # @NOTE? Do we want a way for our leia-action to configure apparmor since |
| 63 | + # this might break a whole bunch of tests? or is this literally just a thing |
| 64 | + # for the platform.sh mysql/mariadb container? |
| 65 | + - name: Configure apparmor |
| 66 | + run: | |
| 67 | + set -x |
| 68 | + sudo apt-get remove mysql-server --purge |
| 69 | + sudo apt-get install apparmor-profiles |
| 70 | + sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld |
| 71 | + - name: Run leia tests |
| 72 | + shell: bash |
| 73 | + run: yarn leia "./${{ matrix.leia-tests }}/README.md" -c 'Destroy tests' --stdin --shell bash |
| 74 | + |
0 commit comments