79 lines
2.2 KiB
YAML
79 lines
2.2 KiB
YAML
name: Run nightly tests
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
schedule:
|
|
- cron: '0 20 * * *' # Every day at 20:00 UTC
|
|
push:
|
|
jobs:
|
|
build:
|
|
runs-on: [ubuntu-latest, cloud]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v4
|
|
with:
|
|
go-version: '1.23'
|
|
- name: build
|
|
working-directory: ./src
|
|
run: |
|
|
go build
|
|
- name: Upload artifacts
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
path: ${{ github.workspace }}/src/home-automation-backend
|
|
name: home-automation-backend_build_${{ github.run_number }}
|
|
retention-days: 1
|
|
|
|
nightly-tests-play:
|
|
runs-on: [ubuntu-latest, cloud]
|
|
needs: build
|
|
steps:
|
|
- name: Modify hosts file
|
|
run: |
|
|
echo -e 127.0.0.1 api.notion.com\n >> /etc/hosts
|
|
- name: Start a dummy server listening on 443
|
|
run: |
|
|
apt update
|
|
apt install -y netcat-traditional
|
|
while true; do
|
|
echo "HTTP/1.1 200 OK\\n\\nHello from dummy server" | nc -l -p 443 -q 1
|
|
done &
|
|
- name: Try curl the dummy server on port 443
|
|
run: |
|
|
apt-get update
|
|
apt-get install -y bind9-host
|
|
cat /etc/hosts
|
|
host api.notion.com
|
|
curl -k https://localhost:443
|
|
# - name: Download artifacts
|
|
# uses: actions/download-artifact@v3
|
|
# with:
|
|
# name: home-automation-backend_build_${{ github.run_number }}
|
|
# - name: Print helping message
|
|
# run: |
|
|
# chmod +x ${GITHUB_WORKSPACE}/home-automation-backend
|
|
# ${GITHUB_WORKSPACE}/home-automation-backend help
|
|
|
|
# nightly-tests:
|
|
# runs-on: [ubuntu-latest, cloud]
|
|
# needs: build
|
|
# steps:
|
|
# - uses: actions/checkout@v4
|
|
# - name: Download artifacts
|
|
# uses: actions/download-artifact@v3
|
|
# with:
|
|
# name: home-automation-backend_build_${{ github.run_number }}
|
|
# - name: Check files
|
|
# run: ls -lR
|
|
# - name: Set up Go
|
|
# uses: actions/setup-go@v4
|
|
# with:
|
|
# go-version: '1.23'
|
|
# - name: build
|
|
# run: go build
|
|
# - name: Run nightly tests
|
|
# working-directory: ./tests
|
|
# run: go test -v --short ./...
|