Refactor env variables #4015
Workflow file for this run
This file contains hidden or 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: WASPC-CI | |
on: | |
workflow_call: | |
workflow_dispatch: | |
push: | |
paths: | |
- "waspc/**" | |
branches: | |
- main | |
- release | |
pull_request: | |
paths: | |
- "waspc/**" | |
schedule: | |
# Additionally run once per week (At 00:00 on Sunday) to avoid loosing cache | |
# (GH deletes it after 7 days of not using it). | |
- cron: "0 0 * * 0" | |
env: | |
WASP_TELEMETRY_DISABLE: 1 | |
defaults: | |
run: | |
shell: bash | |
working-directory: waspc | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: Build Wasp | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: | |
# We are using a fixed Ubuntu version instead of 'ubuntu-latest' to | |
# prevent the version from changing on its own. | |
# | |
# We also set the Ubuntu version to the oldest supported LTS version | |
# rather than the latest LTS version. Doing so avoids GLIBC version | |
# mismatch errors (and possibly other similar issues). | |
# | |
# This might become redundant if we start building with Alpine/Musl | |
# and link the binaries statically: | |
# https://github.com/wasp-lang/wasp/issues/650#issuecomment-1180488040 | |
- ubuntu-22.04 | |
- macos-13 | |
- windows-latest | |
node-version: | |
- "latest" | |
ghc: | |
- "8.10.7" | |
cabal: | |
- "3.6.2.0" | |
# In addition to the default matrix, we also want to run the build job for | |
# additional Node.js versions, to make sure that Wasp works with them. | |
# To reduce the number of jobs, we only test the Node.js versions on | |
# Ubuntu 20.04. | |
include: | |
- os: ubuntu-22.04 | |
node-version: 20 | |
ghc: "8.10.7" | |
cabal: "3.6.2.0" | |
- os: ubuntu-22.04 | |
node-version: 22 | |
ghc: "8.10.7" | |
cabal: "3.6.2.0" | |
steps: | |
- name: Configure git | |
working-directory: ~ | |
# For waspc parser tests, we need to make sure git doesn't convert line | |
# endings to CRLF during checkout on Windows because that would cause | |
# the test cases to fail. | |
run: | | |
git config --global core.autocrlf input | |
git config --global core.eol lf | |
- uses: "actions/checkout@v4" | |
with: | |
# Workaround for a Github Checkout action bug | |
# https://github.com/actions/checkout/issues/1359#issuecomment-1567902034 | |
ref: ${{ github.event.pull_request.head.sha }} | |
# TODO: This is a temporary workaround for the failing GHCup installation on Ubuntu 20.04. | |
# The fix will be propagated in a few days, so we can remove this workaround then. | |
# https://github.com/actions/runner-images/issues/7061 | |
- name: Workaround runner image issue | |
if: matrix.os == 'ubuntu-22.04' | |
run: sudo chown -R $USER /usr/local/.ghcup | |
- name: Set up Haskell | |
uses: ./.github/actions/setup-haskell | |
with: | |
ghc-version: ${{ matrix.ghc }} | |
cabal-version: ${{ matrix.cabal }} | |
cabal-project-dir: waspc | |
- name: Set up Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: packages/ts-inspect - Run tests | |
if: matrix.os == 'ubuntu-22.04' || matrix.os == 'macos-13' | |
run: | | |
cd packages/ts-inspect | |
npm ci | |
npm test | |
- name: Compile TS packages and move it into the Cabal data dir | |
if: matrix.os == 'ubuntu-22.04' || matrix.os == 'macos-13' | |
run: ./tools/install_packages_to_data_dir.sh | |
- name: Build external dependencies | |
run: cabal build --enable-tests --enable-benchmarks --only-dependencies | |
- name: Build wasp code | |
run: cabal build all | |
- name: On MacOS, skip e2e tests with Docker since it is not installed | |
if: matrix.os == 'macos-13' | |
run: export WASP_E2E_TESTS_SKIP_DOCKER=1 | |
- name: Run unit tests | |
run: cabal test cli-test waspc-test waspls-test | |
- name: Ensure examples/todoApp compiles and builds | |
if: matrix.os == 'ubuntu-22.04' || matrix.os == 'macos-13' | |
run: ./examples/todoApp/ensure_app_compiles_and_builds.sh | |
- name: Headless - Cache Node Modules | |
id: headless-cache-node-modules | |
uses: actions/cache@v4 | |
if: matrix.os == 'ubuntu-22.04' | |
with: | |
path: ~/.npm | |
key: node-modules-${{ hashFiles('./waspc/headless-test/package-lock.json') }}-${{ matrix.os }}-${{ matrix.node-version }} | |
- name: Headless - Install wasp-cli for testing | |
id: headless-install-wasp-cli | |
if: matrix.os == 'ubuntu-22.04' | |
run: cabal install | |
- name: Headless - Install Dependencies | |
id: headless-install-dependencies | |
if: matrix.os == 'ubuntu-22.04' | |
run: | | |
cd examples/todoApp | |
npm ci | |
- name: Headless - Store Playwright's Version | |
id: headless-store-playwright-version | |
if: matrix.os == 'ubuntu-22.04' | |
run: | | |
cd examples/todoApp | |
PLAYWRIGHT_VERSION=$(npm ls @playwright/test | grep @playwright | sed 's/.*@//') | |
echo "Playwright's Version: $PLAYWRIGHT_VERSION" | |
echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV | |
- name: Headless - Cache Playwright Browsers for Playwright's Version | |
id: headless-cache-playwright-browsers | |
if: matrix.os == 'ubuntu-22.04' | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/ms-playwright | |
key: playwright-browsers-${{ env.PLAYWRIGHT_VERSION }} | |
- name: Headless - Setup Playwright | |
id: headless-setup-playwright | |
if: steps.cache-playwright-browsers.outputs.cache-hit != 'true' && matrix.os == 'ubuntu-22.04' | |
run: | | |
cd examples/todoApp | |
npx playwright install --with-deps | |
- name: Headless - Run Playwright Tests (dev) | |
id: headless-run-playwright-tests-dev | |
if: matrix.os == 'ubuntu-22.04' | |
run: | | |
cd examples/todoApp | |
# Prepare the environment for the tests | |
cp .env.server.headless .env.server | |
HEADLESS_TEST_MODE=dev npm run test | |
- name: Headless - Run Playwright Tests (build) | |
id: headless-run-playwright-tests-build | |
if: matrix.os == 'ubuntu-22.04' | |
run: | | |
cd examples/todoApp | |
# Prepare the environment for the tests | |
cp .env.server.headless .env.server | |
HEADLESS_TEST_MODE=build npm run test | |
- name: Run e2e tests | |
run: cabal test e2e-test |