Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use devenv in Github Action #25

Closed
wants to merge 36 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
f022068
new workflows
jgoux Oct 18, 2023
de83900
fix shell
jgoux Oct 18, 2023
61b65d6
shell shell shell shell
jgoux Oct 18, 2023
bc04d24
remove shell
jgoux Oct 18, 2023
2c4c8f1
use js language
jgoux Oct 18, 2023
ac174a1
wip
jgoux Oct 18, 2023
61cd5a1
try cache
jgoux Oct 18, 2023
4d36cbd
try things
jgoux Oct 18, 2023
5b84283
bump deps
jgoux Oct 18, 2023
68d04cf
another try
jgoux Oct 18, 2023
716190c
check individual times
jgoux Oct 18, 2023
758004c
try devenv 1.0
jgoux Oct 19, 2023
32ac2bc
Merge branch 'main' into devenv-github-action
jgoux Oct 19, 2023
9a6049b
fix pnpm lock
jgoux Oct 19, 2023
8fff241
fix install devenv link
jgoux Oct 19, 2023
b58e607
disable magix nix cache
jgoux Oct 19, 2023
6d12ad0
install using cachix
jgoux Oct 19, 2023
375b489
report changes
jgoux Oct 19, 2023
2c1e4c3
match playwright version
jgoux Oct 23, 2023
9e199f9
remove setup playwright
jgoux Oct 23, 2023
98ab9a6
try cache-nix-action
jgoux Oct 24, 2023
2139df8
don't load nix config
jgoux Oct 24, 2023
5fe9600
try flake
jgoux Oct 24, 2023
0d086cf
Revert "try flake"
jgoux Oct 24, 2023
0431e8b
try nixbuild/nix-quick-install-action@master
jgoux Oct 24, 2023
0d89c7e
disable load_nixConfig
jgoux Oct 24, 2023
2826e81
Merge branch 'main' into devenv-github-action
jgoux Oct 24, 2023
270d987
retry using playwright deps
jgoux Oct 24, 2023
1170ee6
use devenv shell
jgoux Oct 24, 2023
2ac487c
up
jgoux Oct 24, 2023
c70bcdf
playwright in nix
jgoux Oct 24, 2023
a6fe59a
remove setup playwright
jgoux Oct 24, 2023
ac44aa3
try load_nixConfig: true
jgoux Oct 24, 2023
879c66b
remove default
jgoux Oct 24, 2023
685866a
bump
jgoux Oct 24, 2023
e5e508f
v26
jgoux Oct 24, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/actions/devenv/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Setup devenv

runs:
using: "composite"
steps:
- name: Install Nix
uses: nixbuild/nix-quick-install-action@v26

- name: Restore and cache Nix store
uses: nix-community/cache-nix-action@v4
with:
key: cache-${{ runner.os }}-nix-store-${{ hashFiles('**/*.nix') }}
restore-keys: |
cache-${{ runner.os }}-nix-store-

- name: Setup Cachix
uses: cachix/cachix-action@v12
with:
name: devenv

- name: Install devenv.sh
shell: bash
run: nix profile install tarball+https://install.devenv.sh/python-rewrite

- name: Build the devenv shell
shell: bash
run: devenv ci
19 changes: 3 additions & 16 deletions .github/actions/install/action.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,10 @@
name: Install
name: Install dependencies

runs:
using: "composite"
steps:
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 18

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
run_install: false

- name: Get pnpm store directory
shell: bash
shell: devenv shell bash -e {0}
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

Expand All @@ -27,8 +17,5 @@ runs:
${{ runner.os }}-pnpm-store-

- name: Install dependencies
shell: bash
shell: devenv shell bash -e {0}
run: pnpm install

- name: Setup environment variables
uses: ./.github/actions/setup-env
9 changes: 1 addition & 8 deletions .github/actions/setup-env/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@ name: Setup environment variables
runs:
using: "composite"
steps:
# TODO: use devenv or npm or cache the binary
- name: Install Infisical CLI
shell: bash
run: |
curl -1sLf 'https://dl.cloudsmith.io/public/infisical/infisical-cli/setup.deb.sh' | sudo -E bash
sudo apt-get update && sudo apt-get install -y infisical

- name: Pull .env files
shell: bash
shell: devenv shell bash -e {0}
run: pnpm env:pull
22 changes: 0 additions & 22 deletions .github/actions/setup-playwright/action.yml

This file was deleted.

13 changes: 13 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Setup

runs:
using: "composite"
steps:
- name: Setup devenv
uses: ./.github/actions/devenv

- name: Install dependencies
uses: ./.github/actions/install

- name: Setup environment variables
uses: ./.github/actions/setup-env
8 changes: 7 additions & 1 deletion .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,11 @@
"automerge": true,
"timezone": "Europe/Paris",
"schedule": ["after 9am and before 10am"],
"postUpdateOptions": ["pnpmDedupe"]
"postUpdateOptions": ["pnpmDedupe"],
"packageRules": [
{
"matchPackagePatterns": ["@playwright/*"],
"allowedVersions": "=1.38.0"
}
]
}
41 changes: 18 additions & 23 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ concurrency:
group: tests-${{ github.head_ref }}
cancel-in-progress: true

defaults:
run:
shell: devenv shell bash -e {0}

env:
INFISICAL_ENV: ${{ vars.INFISICAL_ENV }}
INFISICAL_TOKEN: ${{ secrets.INFISICAL_TOKEN }}
Expand All @@ -29,8 +33,8 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Install
uses: ./.github/actions/install
- name: Setup
uses: ./.github/actions/setup

- name: Type check
run: pnpm type-check
Expand All @@ -46,8 +50,8 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Install
uses: ./.github/actions/install
- name: Setup
uses: ./.github/actions/setup

- name: Lint
run: pnpm lint
Expand All @@ -63,8 +67,8 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Install
uses: ./.github/actions/install
- name: Setup
uses: ./.github/actions/setup

- name: Lint monorepo
run: pnpm lint-monorepo
Expand All @@ -80,8 +84,8 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Install
uses: ./.github/actions/install
- name: Setup
uses: ./.github/actions/setup

- name: Run unit and integration tests
run: pnpm test
Expand All @@ -97,11 +101,8 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Install
uses: ./.github/actions/install

- name: Setup Playwright
uses: ./.github/actions/setup-playwright
- name: Setup
uses: ./.github/actions/setup

- name: Run components tests
run: pnpm test:components
Expand All @@ -117,11 +118,8 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Install
uses: ./.github/actions/install

- name: Setup Playwright
uses: ./.github/actions/setup-playwright
- name: Setup
uses: ./.github/actions/setup

- name: Run Storybook tests
run: pnpm test:storybook
Expand All @@ -137,11 +135,8 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Install
uses: ./.github/actions/install

- name: Setup Playwright
uses: ./.github/actions/setup-playwright
- name: Setup
uses: ./.github/actions/setup

- name: Run E2E tests
run: pnpm test:e2e
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/update-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,5 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Install
uses: ./.github/actions/install

- name: Setup Playwright
uses: ./.github/actions/setup-playwright
- name: Setup
uses: ./.github/actions/setup
6 changes: 3 additions & 3 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
},
"devDependencies": {
"@acme/eslint-config": "workspace:*",
"@playwright/experimental-ct-react": "1.39.0",
"@playwright/test": "1.39.0",
"@playwright/experimental-ct-react": "1.38.0",
"@playwright/test": "1.38.0",
"@storybook/addon-a11y": "7.5.1",
"@storybook/addon-essentials": "7.5.1",
"@storybook/addon-interactions": "7.5.1",
Expand All @@ -44,7 +44,7 @@
"axe-playwright": "1.2.3",
"eslint": "8.52.0",
"start-server-and-test": "2.0.1",
"storybook": "^7.4.6",
"storybook": "^7.5.1",
"typescript": "5.2.2",
"vite": "4.5.0",
"vite-bundle-visualizer": "0.10.0"
Expand Down
Loading
Loading