Fix tests #294
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: Template Integration Tests | |
on: | |
push: | |
branches: | |
- main | |
# The following two branch names can be used to force build a version for development and sharing a patch. | |
- "integration-testing-*" | |
defaults: | |
run: | |
working-directory: codegenerator/integration_tests | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build_and_test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup rust cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/git | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
# using both of these paths to hedge bets on which is correct. | |
./codegenerator/target | |
./target | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
${{ runner.os }}-cargo- | |
- uses: pnpm/action-setup@v3 | |
with: | |
version: "8.9" | |
- name: Get pnpm store directory (if this seems stable and static we can hard-code it again) # Source: https://github.com/pnpm/action-setup#use-cache-to-reduce-installation-time | |
id: pnpm-cache | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v3 | |
name: Setup pnpm cache | |
with: | |
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
${{ runner.os }}-pnpm-store- | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "20.x" | |
- name: Pre-pull docker-compose images | |
run: | | |
cd ../cli/templates/static/codegen # we use the docker-compose.yml in the static folder | |
docker compose pull | |
- name: Mock gio | |
run: | | |
mkdir -p /home/runner/.local/bin # This is on the path by default | |
echo 'echo "running mock gio"' > /home/runner/.local/bin/gio && chmod +x /home/runner/.local/bin/gio | |
echo 'echo "running mock xdg-open"' > /home/runner/.local/bin/xdg-open && chmod +x /home/runner/.local/bin/xdg-open | |
- name: run integration tests | |
env: | |
LOG_LEVEL: trace | |
run: | | |
./tests/runAll.sh | |
- name: Test Failure | |
uses: rjstone/discord-webhook-notify@e3fdffbe09fc784fef3788aecf3ca806719aa7e3 | |
if: failure() | |
with: | |
severity: error | |
details: "Integration test Failed - in main (make sure to fix before releasing a new version)! (CC: <@&Devs> )" | |
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }} | |
- name: Test Cancelled | |
uses: rjstone/discord-webhook-notify@v1 | |
if: cancelled() | |
with: | |
severity: warn | |
details: Integration Test Cancelled - make sure the cancelation was intentional | |
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }} |