This app is a POC / Tutorial to run Forgero Actions on a Vue app, in Docker, for Windows
- Docker Desktop
- Go
- A server to run Forgejo on
- A testing server (will be your own machine in this tutorial)
- Pull the docker image
docker pull codeberg.org/forgejo/forgejo:8.0.3
- Create a container with the image and set the port to
3000
- Run the container and go to
localhost:3000
- Create the instance, set admin user settings
- Create an organization
- Create a repository
- Activate Actions
These steps should be done on your testing server (a separated one from your Forgejo server)
- clone the runner repository
https://code.forgejo.org/forgejo/runner
- [optional] either stay on
main
branch or checkout the last tag$ git checkout v3.5.1
- run
$ cd runner
- run
$ go build
for windows user Go should be installed on your machine. For linux users you can directly start the .sh file in the tag release
Connect the runner to the forgejo server
- In the same cmd run
$ ./act_runner register
- Create a new runner, get the token from http://localhost:3000/user/settings/actions/runners
- Forgejo URL should be your local IP ex: http://192.168.1.31:3000/ (your computer).
localhost:3000
will not work because the test docker created won't have access to your local machine - Go to http://localhost:3000/user/settings/actions/runners to check if your runner has been registered and is idling
The runner will pull tasks from the Forgejo server and execute them
- run
$ ./act_runner daemon
In your git repository, create a folder .forgejo/workflow/
Inside create a file test_actions.yaml
# your_repo/.forgejo/workflows/test_actions.yaml
name: Forgejo Action CI
on:
push:
branches: [ main ]
jobs:
unit-tests:
runs-on: docker
steps:
- name: Setup node
uses: actions/setup-node@v4
- name: Check out repository code
uses: actions/checkout@v4
- name: npm install
run: 'npm ci'
- name: Unit test
run: 'npm run test:unit'
cypress-e2e:
runs-on: docker
needs: unit-tests
container:
image: cypress/base
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cypress run
uses: cypress-io/github-action@v6
with:
build: npm run build
start: npm run preview
browser: electron # or chrome, depends on your container image
- Commit some changes and push to the git server
- Go to http://localhost:3000/{yourOrga}/{your_repo}/actions
- See the tests running
- Taaadaaa all tests are green !